|
8 | 8 | branches: |
9 | 9 | - "2.0.x" |
10 | 10 |
|
| 11 | +concurrency: |
| 12 | + group: build-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches |
| 13 | + cancel-in-progress: true |
| 14 | + |
11 | 15 | jobs: |
12 | 16 | lint: |
13 | 17 | name: "Lint" |
@@ -213,3 +217,67 @@ jobs: |
213 | 217 |
|
214 | 218 | - name: "PHPStan" |
215 | 219 | run: "make phpstan" |
| 220 | + |
| 221 | + mutation-testing: |
| 222 | + name: "Mutation Testing" |
| 223 | + runs-on: "ubuntu-latest" |
| 224 | + needs: ["tests", "static-analysis"] |
| 225 | + |
| 226 | + strategy: |
| 227 | + fail-fast: false |
| 228 | + matrix: |
| 229 | + php-version: |
| 230 | + - "8.2" |
| 231 | + - "8.3" |
| 232 | + - "8.4" |
| 233 | + operating-system: [ubuntu-latest] |
| 234 | + |
| 235 | + steps: |
| 236 | + - name: "Checkout" |
| 237 | + uses: actions/checkout@v5 |
| 238 | + |
| 239 | + - name: "Checkout build-infection" |
| 240 | + uses: actions/checkout@v5 |
| 241 | + with: |
| 242 | + repository: "phpstan/build-infection" |
| 243 | + path: "build-infection" |
| 244 | + ref: "1.x" |
| 245 | + |
| 246 | + - uses: ./build-infection/.github/actions/setup-php |
| 247 | + with: |
| 248 | + php-version: "${{ matrix.php-version }}" |
| 249 | + extensions: mbstring |
| 250 | + |
| 251 | + - name: "Install dependencies" |
| 252 | + run: "composer install --no-interaction --no-progress" |
| 253 | + |
| 254 | + - name: "Install build-infection dependencies" |
| 255 | + working-directory: "build-infection" |
| 256 | + run: "composer install --no-interaction --no-progress" |
| 257 | + |
| 258 | + - name: "Configure infection" |
| 259 | + run: | |
| 260 | + php build-infection/bin/infection-config.php \ |
| 261 | + > infection.json5 |
| 262 | + cat infection.json5 | jq |
| 263 | +
|
| 264 | + - name: "Cache Result cache" |
| 265 | + uses: actions/cache@v4 |
| 266 | + with: |
| 267 | + path: ./tmp |
| 268 | + key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}" |
| 269 | + restore-keys: | |
| 270 | + result-cache-v1-${{ matrix.php-version }}- |
| 271 | +
|
| 272 | + - name: "Run infection" |
| 273 | + run: | |
| 274 | + git fetch --depth=1 origin $GITHUB_BASE_REF |
| 275 | + infection \ |
| 276 | + --git-diff-base=origin/$GITHUB_BASE_REF \ |
| 277 | + --git-diff-lines \ |
| 278 | + --ignore-msi-with-no-mutations \ |
| 279 | + --min-msi=100 \ |
| 280 | + --min-covered-msi=100 \ |
| 281 | + --log-verbosity=all \ |
| 282 | + --debug \ |
| 283 | + --logger-text=php://stdout |
0 commit comments