# https://docs.github.com/en/actions name: Mutation tests on: push: branches: - master paths: - '*/classes/**.php' pull_request: branches: - master paths: - '*/classes/**.php' permissions: contents: read jobs: infection: name: Infection runs-on: ${{ matrix.operating-system }} strategy: matrix: php-version: - "8.1" operating-system: - ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - name: Install Gettext run: sudo apt-get install -y gettext - name: Generate mo files run: ./scripts/generate-mo --quiet - name: Set up PHP ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} coverage: pcov ini-values: memory_limit=-1 tools: composer:v2, phive - name: Install Infection # The GPG key can be found at https://infection.github.io/guide/installation.html run: phive --no-progress install --target ./build/tools --trust-gpg-keys C5095986493B4AA0 infection - name: Install Composer dependencies uses: ramsey/composer-install@v2 with: dependency-versions: highest - name: Collect coverage report run: composer run phpunit -- --testsuite unit --stop-on-failure - name: Run Infection for changed files only if: github.event_name == 'pull_request' run: | git fetch --depth=1 origin $GITHUB_BASE_REF ./build/tools/infection -j$(nproc) --git-diff-lines --git-diff-base=origin/$GITHUB_BASE_REF \ --logger-github --ignore-msi-with-no-mutations --only-covered \ --skip-initial-tests --coverage=build/logs --no-interaction --no-progress - name: Run Infection if: github.event_name == 'push' env: INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }} run: ./build/tools/infection -j$(nproc) --skip-initial-tests --coverage=build/logs --no-interaction --no-progress