diff --git a/.github/workflows/infection.yml b/.github/workflows/infection.yml index 5e233b6..e9d5af7 100644 --- a/.github/workflows/infection.yml +++ b/.github/workflows/infection.yml @@ -1,61 +1,24 @@ --- -name: 🧬 Mutation Tests - on: # yamllint disable-line rule:truthy pull_request: push: branches: - 1.x +name: 🧬 Mutation Tests + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read jobs: infection: - name: Infection · PHP ${{ matrix.php-version }} - timeout-minutes: 10 - runs-on: ${{ matrix.os }} - concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - group: infection-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - php-version: - - '8.4' - dependencies: - - highest - steps: - - name: 📦 Check out the codebase - uses: actions/checkout@v6 - with: - persist-credentials: false - - - name: 🛠️ Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - extensions: pdo, pdo_sqlite - ini-values: error_reporting=E_ALL - coverage: xdebug - - - name: 📥 Install dependencies with composer - uses: ramsey/composer-install@v3 - env: - COMPOSER_ROOT_VERSION: '1.x-dev' - with: - dependency-versions: ${{ matrix.dependencies }} - - - name: 📥 Install Infection - run: composer bin infection install --no-interaction --no-progress + name: Infection + uses: cycle/gh-actions/.github/workflows/infection.yml@master + secrets: inherit - - name: 🧬 Run mutation testing with Infection - run: composer infect:ci - env: - # Upload the report to the Stryker dashboard only on push to 1.x. - # On pull requests (and forks) the key is empty, so Infection skips the upload - # instead of overwriting the branch report with PR data. - STRYKER_DASHBOARD_API_KEY: ${{ github.event_name == 'push' && secrets.STRYKER_DASHBOARD_API_KEY || '' }} +... diff --git a/composer.json b/composer.json index fa07819..b153ecb 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,6 @@ "roxblnfk/unpoly": "^1.8", "spiral/boot": "^3.18", "spiral/cycle-bridge": "^2.13", - "testo/bridge-infection": "^0.1.9", "testo/testo": "^0.10.60", "yiisoft/di": "^1.4" }, @@ -72,14 +71,20 @@ "infect": [ "Composer\\Config::disableProcessTimeout", "@putenv XDEBUG_MODE=coverage", + "@putenv DB_DRIVERS=sqlite", "infection --configuration=infection.json --threads=max" ], "infect:ci": [ "Composer\\Config::disableProcessTimeout", "@putenv XDEBUG_MODE=coverage", - "infection --ansi --configuration=infection.json --logger-github --threads=max --show-mutations=0 --min-msi=50" + "@putenv DB_DRIVERS=sqlite", + "infection --ansi --configuration=infection.json --logger-github --threads=max --show-mutations=0" ] }, + "scripts-descriptions": { + "infect": "Run mutation testing with Infection (install it first: composer bin infection install)", + "infect:ci": "Run mutation testing in CI: GitHub annotations and the MSI thresholds" + }, "extra": { "laravel": { "providers": [ diff --git a/infection.json b/infection.json index 7a48630..949b316 100644 --- a/infection.json +++ b/infection.json @@ -6,8 +6,9 @@ ] }, "timeout": 10, + "minMsi": 95, + "minCoveredMsi": 95, "testFramework": "testo", - "testFrameworkOptions": "--suite=Unit", "tmpDir": "runtime", "logs": { "stryker": { diff --git a/vendor-bin/infection/composer.json b/vendor-bin/infection/composer.json index 8436e13..9709365 100644 --- a/vendor-bin/infection/composer.json +++ b/vendor-bin/infection/composer.json @@ -1,6 +1,6 @@ { "require": { - "infection/infection": "^0.35", + "infection/infection": "^0.35.12", "testo/bridge-infection": "^0.1.9" }, "config": {