|
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" |
@@ -159,3 +163,67 @@ jobs: |
159 | 163 |
|
160 | 164 | - name: "PHPStan" |
161 | 165 | run: "make phpstan" |
| 166 | + |
| 167 | + mutation-testing: |
| 168 | + name: "Mutation Testing" |
| 169 | + runs-on: "ubuntu-latest" |
| 170 | + needs: ["tests", "static-analysis"] |
| 171 | + |
| 172 | + strategy: |
| 173 | + fail-fast: false |
| 174 | + matrix: |
| 175 | + php-version: |
| 176 | + - "8.2" |
| 177 | + - "8.3" |
| 178 | + - "8.4" |
| 179 | + operating-system: [ubuntu-latest] |
| 180 | + |
| 181 | + steps: |
| 182 | + - name: "Checkout" |
| 183 | + uses: actions/checkout@v5 |
| 184 | + |
| 185 | + - name: "Checkout build-infection" |
| 186 | + uses: actions/checkout@v5 |
| 187 | + with: |
| 188 | + repository: "phpstan/build-infection" |
| 189 | + path: "build-infection" |
| 190 | + ref: "1.x" |
| 191 | + |
| 192 | + - uses: ./build-infection/.github/actions/setup-php |
| 193 | + with: |
| 194 | + php-version: "${{ matrix.php-version }}" |
| 195 | + extensions: mbstring |
| 196 | + |
| 197 | + - name: "Install dependencies" |
| 198 | + run: "composer install --no-interaction --no-progress" |
| 199 | + |
| 200 | + - name: "Install build-infection dependencies" |
| 201 | + working-directory: "build-infection" |
| 202 | + run: "composer install --no-interaction --no-progress" |
| 203 | + |
| 204 | + - name: "Configure infection" |
| 205 | + run: | |
| 206 | + php build-infection/bin/infection-config.php \ |
| 207 | + > infection.json5 |
| 208 | + cat infection.json5 | jq |
| 209 | +
|
| 210 | + - name: "Cache Result cache" |
| 211 | + uses: actions/cache@v4 |
| 212 | + with: |
| 213 | + path: ./tmp |
| 214 | + key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}" |
| 215 | + restore-keys: | |
| 216 | + result-cache-v1-${{ matrix.php-version }}- |
| 217 | +
|
| 218 | + - name: "Run infection" |
| 219 | + run: | |
| 220 | + git fetch --depth=1 origin $GITHUB_BASE_REF |
| 221 | + infection \ |
| 222 | + --git-diff-base=origin/$GITHUB_BASE_REF \ |
| 223 | + --git-diff-lines \ |
| 224 | + --ignore-msi-with-no-mutations \ |
| 225 | + --min-msi=100 \ |
| 226 | + --min-covered-msi=100 \ |
| 227 | + --log-verbosity=all \ |
| 228 | + --debug \ |
| 229 | + --logger-text=php://stdout |
0 commit comments