|  | 
| 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,72 @@ 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: "Install PHP" | 
|  | 186 | +        uses: "shivammathur/setup-php@v2" | 
|  | 187 | +        with: | 
|  | 188 | +          coverage: "pcov" | 
|  | 189 | +          php-version: "${{ matrix.php-version }}" | 
|  | 190 | +          tools: pecl, infection:0.31.7 | 
|  | 191 | +          extensions: mbstring | 
|  | 192 | +          ini-file: development | 
|  | 193 | +          ini-values: memory_limit=-1 | 
|  | 194 | + | 
|  | 195 | +      - name: "Install dependencies" | 
|  | 196 | +        run: "composer install --no-interaction --no-progress" | 
|  | 197 | + | 
|  | 198 | +      - name: "Checkout build-infection" | 
|  | 199 | +        uses: actions/checkout@v5 | 
|  | 200 | +        with: | 
|  | 201 | +          repository: "phpstan/build-infection" | 
|  | 202 | +          path: "build-infection" | 
|  | 203 | +          ref: "1.x" | 
|  | 204 | + | 
|  | 205 | +      - name: "Install build-infection dependencies" | 
|  | 206 | +        working-directory: "build-infection" | 
|  | 207 | +        run: "composer install --no-interaction --no-progress" | 
|  | 208 | + | 
|  | 209 | +      - name: "Configure infection" | 
|  | 210 | +        run: | | 
|  | 211 | +          php build-infection/bin/infection-config.php \ | 
|  | 212 | +          > infection.json5 | 
|  | 213 | +          cat infection.json5 | jq | 
|  | 214 | +
 | 
|  | 215 | +      - name: "Cache Result cache" | 
|  | 216 | +        uses: actions/cache@v4 | 
|  | 217 | +        with: | 
|  | 218 | +          path: ./tmp | 
|  | 219 | +          key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}" | 
|  | 220 | +          restore-keys: | | 
|  | 221 | +            result-cache-v1-${{ matrix.php-version }}- | 
|  | 222 | +
 | 
|  | 223 | +      - name: "Run infection" | 
|  | 224 | +        run: | | 
|  | 225 | +          git fetch --depth=1 origin $GITHUB_BASE_REF | 
|  | 226 | +          infection \ | 
|  | 227 | +            --git-diff-base=origin/$GITHUB_BASE_REF \ | 
|  | 228 | +            --git-diff-lines \ | 
|  | 229 | +            --ignore-msi-with-no-mutations \ | 
|  | 230 | +            --min-msi=100 \ | 
|  | 231 | +            --min-covered-msi=100 \ | 
|  | 232 | +            --log-verbosity=all \ | 
|  | 233 | +            --debug \ | 
|  | 234 | +            --logger-text=php://stdout | 
0 commit comments