|
67 | 67 | - name: "Test autoloader for production" |
68 | 68 | run: "php autoloader.php" |
69 | 69 |
|
| 70 | + code-coverage: |
| 71 | + name: "Code Coverage" |
| 72 | + |
| 73 | + runs-on: "ubuntu-latest" |
| 74 | + |
| 75 | + strategy: |
| 76 | + matrix: |
| 77 | + php-version: |
| 78 | + - "8.2" |
| 79 | + |
| 80 | + dependencies: |
| 81 | + - "locked" |
| 82 | + |
| 83 | + steps: |
| 84 | + - name: "Checkout" |
| 85 | + |
| 86 | + |
| 87 | + - name: "Set up PHP" |
| 88 | + uses: "shivammathur/[email protected]" |
| 89 | + with: |
| 90 | + coverage: "xdebug" |
| 91 | + extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter" |
| 92 | + php-version: "${{ matrix.php-version }}" |
| 93 | + |
| 94 | + - name: "Set up problem matchers for PHP" |
| 95 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" |
| 96 | + |
| 97 | + - name: "Set up problem matchers for phpunit/phpunit" |
| 98 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"" |
| 99 | + |
| 100 | + - name: "Determine composer cache directory" |
| 101 | + uses: "ergebnis/.github/actions/composer/[email protected]" |
| 102 | + |
| 103 | + - name: "Cache dependencies installed with composer" |
| 104 | + |
| 105 | + with: |
| 106 | + path: "${{ env.COMPOSER_CACHE_DIR }}" |
| 107 | + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" |
| 108 | + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" |
| 109 | + |
| 110 | + - name: "Install ${{ matrix.dependencies }} dependencies with composer" |
| 111 | + uses: "ergebnis/.github/actions/composer/[email protected]" |
| 112 | + with: |
| 113 | + dependencies: "${{ matrix.dependencies }}" |
| 114 | + |
| 115 | + - name: "Collect code coverage with Xdebug and phpunit/phpunit" |
| 116 | + env: |
| 117 | + XDEBUG_MODE: "coverage" |
| 118 | + run: "vendor/bin/phpunit --colors=always --configuration=phpunit.xml --coverage-clover=.build/phpunit/logs/clover.xml" |
| 119 | + |
| 120 | + - name: "Send code coverage report to codecov.io" |
| 121 | + |
| 122 | + with: |
| 123 | + files: ".build/phpunit/logs/clover.xml" |
| 124 | + token: "${{ secrets.CODECOV_TOKEN }}" |
70 | 125 | coding-standards: |
71 | 126 | name: "Coding Standards" |
72 | 127 |
|
@@ -190,6 +245,53 @@ jobs: |
190 | 245 | - name: "Run maglnet/composer-require-checker" |
191 | 246 | run: ".phive/composer-require-checker check --config-file=$(pwd)/composer-require-checker.json" |
192 | 247 |
|
| 248 | + mutation-tests: |
| 249 | + name: "Mutation Tests" |
| 250 | + |
| 251 | + runs-on: "ubuntu-latest" |
| 252 | + |
| 253 | + strategy: |
| 254 | + matrix: |
| 255 | + php-version: |
| 256 | + - "8.2" |
| 257 | + |
| 258 | + dependencies: |
| 259 | + - "locked" |
| 260 | + |
| 261 | + steps: |
| 262 | + - name: "Checkout" |
| 263 | + |
| 264 | + |
| 265 | + - name: "Set up PHP" |
| 266 | + uses: "shivammathur/[email protected]" |
| 267 | + with: |
| 268 | + coverage: "xdebug" |
| 269 | + extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter" |
| 270 | + php-version: "${{ matrix.php-version }}" |
| 271 | + |
| 272 | + - name: "Set up problem matchers for PHP" |
| 273 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" |
| 274 | + |
| 275 | + - name: "Determine composer cache directory" |
| 276 | + uses: "ergebnis/.github/actions/composer/[email protected]" |
| 277 | + |
| 278 | + - name: "Cache dependencies installed with composer" |
| 279 | + |
| 280 | + with: |
| 281 | + path: "${{ env.COMPOSER_CACHE_DIR }}" |
| 282 | + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" |
| 283 | + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" |
| 284 | + |
| 285 | + - name: "Install ${{ matrix.dependencies }} dependencies with composer" |
| 286 | + uses: "ergebnis/.github/actions/composer/[email protected]" |
| 287 | + with: |
| 288 | + dependencies: "${{ matrix.dependencies }}" |
| 289 | + |
| 290 | + - name: "Run mutation tests with Xdebug and infection/infection" |
| 291 | + env: |
| 292 | + XDEBUG_MODE: "coverage" |
| 293 | + run: "vendor/bin/infection --ansi --configuration=infection.json --logger-github" |
| 294 | + |
193 | 295 | refactoring: |
194 | 296 | name: "Refactoring" |
195 | 297 |
|
@@ -327,3 +429,53 @@ jobs: |
327 | 429 |
|
328 | 430 | - name: "Run vimeo/psalm" |
329 | 431 | run: "vendor/bin/psalm --config=psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4" |
| 432 | + |
| 433 | + tests: |
| 434 | + name: "Tests" |
| 435 | + |
| 436 | + runs-on: "ubuntu-latest" |
| 437 | + |
| 438 | + strategy: |
| 439 | + matrix: |
| 440 | + php-version: |
| 441 | + - "8.2" |
| 442 | + |
| 443 | + dependencies: |
| 444 | + - "lowest" |
| 445 | + - "locked" |
| 446 | + - "highest" |
| 447 | + |
| 448 | + steps: |
| 449 | + - name: "Checkout" |
| 450 | + |
| 451 | + |
| 452 | + - name: "Set up PHP" |
| 453 | + uses: "shivammathur/[email protected]" |
| 454 | + with: |
| 455 | + coverage: "none" |
| 456 | + extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter" |
| 457 | + php-version: "${{ matrix.php-version }}" |
| 458 | + |
| 459 | + - name: "Set up problem matchers for PHP" |
| 460 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" |
| 461 | + |
| 462 | + - name: "Set up problem matchers for phpunit/phpunit" |
| 463 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"" |
| 464 | + |
| 465 | + - name: "Determine composer cache directory" |
| 466 | + uses: "ergebnis/.github/actions/composer/[email protected]" |
| 467 | + |
| 468 | + - name: "Cache dependencies installed with composer" |
| 469 | + |
| 470 | + with: |
| 471 | + path: "${{ env.COMPOSER_CACHE_DIR }}" |
| 472 | + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" |
| 473 | + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" |
| 474 | + |
| 475 | + - name: "Install ${{ matrix.dependencies }} dependencies with composer" |
| 476 | + uses: "ergebnis/.github/actions/composer/[email protected]" |
| 477 | + with: |
| 478 | + dependencies: "${{ matrix.dependencies }}" |
| 479 | + |
| 480 | + - name: "Run unit tests with phpunit/phpunit" |
| 481 | + run: "vendor/bin/phpunit --colors=always --configuration=phpunit.xml" |
0 commit comments