name: akbasic Mutation Testing
run-name: ${{ gitea.actor }} akbasic mutation test

# Mutation testing is intentionally isolated from push and merge checks. The
# complete src/ tree takes hours and must not consume the shared CI capacity
# during normal development.
on:
  # Gitea schedules use UTC. 07:00 UTC is 02:00 EST (the requested fixed
  # Eastern Standard Time slot).
  schedule:
    - cron: '0 7 * * *'
  workflow_dispatch:

jobs:
  full_mutation:
    runs-on: ubuntu-latest
    timeout-minutes: 720
    steps:
      - name: Check out repository code
        uses: actions/checkout@v4
        with:
          submodules: true
      - name: dependencies
        run: |
          sudo apt-get update -y
          sudo apt-get install -y cmake gcc python3 moreutils
      - name: mutation testing (full tree)
        run: |
          python3 scripts/mutation_test.py \
            --junit mutation-junit.xml \
            --threshold 65
      - name: publish mutation results
        if: always()
        uses: mikepenz/action-junit-report@v4
        with:
          report_paths: 'mutation-junit.xml'
          annotate_only: true
          detailed_summary: true
          include_passed: true
          fail_on_failure: 'false'
      - name: upload mutation report
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: mutation-report
          path: mutation-junit.xml
          if-no-files-found: warn
      - run: echo "🍏 This job's status is ${{ job.status }}."
