|
62 | 62 | - name: "Test autoloader for production" |
63 | 63 | run: "php autoloader.php" |
64 | 64 |
|
| 65 | + code-coverage: |
| 66 | + name: "Code Coverage" |
| 67 | + |
| 68 | + runs-on: "ubuntu-latest" |
| 69 | + |
| 70 | + strategy: |
| 71 | + matrix: |
| 72 | + php-version: |
| 73 | + - "8.3" |
| 74 | + |
| 75 | + dependencies: |
| 76 | + - "locked" |
| 77 | + |
| 78 | + steps: |
| 79 | + - name: "Checkout" |
| 80 | + uses: "actions/checkout@v3.3.0" |
| 81 | + |
| 82 | + - name: "Set up PHP" |
| 83 | + uses: "shivammathur/setup-php@2.24.0" |
| 84 | + with: |
| 85 | + coverage: "xdebug" |
| 86 | + extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter" |
| 87 | + php-version: "${{ matrix.php-version }}" |
| 88 | + |
| 89 | + - name: "Set up problem matchers for PHP" |
| 90 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" |
| 91 | + |
| 92 | + - name: "Set up problem matchers for phpunit/phpunit" |
| 93 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"" |
| 94 | + |
| 95 | + - name: "Determine composer cache directory" |
| 96 | + uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.8.0" |
| 97 | + |
| 98 | + - name: "Cache dependencies installed with composer" |
| 99 | + uses: "actions/cache@v3.2.6" |
| 100 | + with: |
| 101 | + path: "${{ env.COMPOSER_CACHE_DIR }}" |
| 102 | + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" |
| 103 | + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" |
| 104 | + |
| 105 | + - name: "Install ${{ matrix.dependencies }} dependencies with composer" |
| 106 | + uses: "ergebnis/.github/actions/composer/install@1.8.0" |
| 107 | + with: |
| 108 | + dependencies: "${{ matrix.dependencies }}" |
| 109 | + |
| 110 | + - name: "Collect code coverage with Xdebug and phpunit/phpunit" |
| 111 | + env: |
| 112 | + XDEBUG_MODE: "coverage" |
| 113 | + run: "vendor/bin/phpunit --colors=always --configuration=phpunit.xml --coverage-clover=.build/phpunit/logs/clover.xml" |
| 114 | + |
| 115 | + - name: "Send code coverage report to codecov.io" |
| 116 | + uses: "codecov/codecov-action@v3.1.1" |
| 117 | + with: |
| 118 | + files: ".build/phpunit/logs/clover.xml" |
| 119 | + token: "${{ secrets.CODECOV_TOKEN }}" |
| 120 | + |
65 | 121 | coding-standards: |
66 | 122 | name: "Coding Standards" |
67 | 123 |
|
@@ -190,6 +246,98 @@ jobs: |
190 | 246 | - name: "Run maglnet/composer-require-checker" |
191 | 247 | run: ".phive/composer-require-checker check --ansi --config-file=$(pwd)/composer-require-checker.json" |
192 | 248 |
|
| 249 | + mutation-tests: |
| 250 | + name: "Mutation Tests" |
| 251 | + |
| 252 | + runs-on: "ubuntu-latest" |
| 253 | + |
| 254 | + strategy: |
| 255 | + matrix: |
| 256 | + php-version: |
| 257 | + - "8.3" |
| 258 | + |
| 259 | + dependencies: |
| 260 | + - "locked" |
| 261 | + |
| 262 | + steps: |
| 263 | + - name: "Checkout" |
| 264 | + uses: "actions/checkout@v3.3.0" |
| 265 | + |
| 266 | + - name: "Set up PHP" |
| 267 | + uses: "shivammathur/setup-php@2.24.0" |
| 268 | + with: |
| 269 | + coverage: "xdebug" |
| 270 | + extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter" |
| 271 | + php-version: "${{ matrix.php-version }}" |
| 272 | + |
| 273 | + - name: "Set up problem matchers for PHP" |
| 274 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" |
| 275 | + |
| 276 | + - name: "Determine composer cache directory" |
| 277 | + uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.8.0" |
| 278 | + |
| 279 | + - name: "Cache dependencies installed with composer" |
| 280 | + uses: "actions/cache@v3.2.6" |
| 281 | + with: |
| 282 | + path: "${{ env.COMPOSER_CACHE_DIR }}" |
| 283 | + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" |
| 284 | + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" |
| 285 | + |
| 286 | + - name: "Install ${{ matrix.dependencies }} dependencies with composer" |
| 287 | + uses: "ergebnis/.github/actions/composer/install@1.8.0" |
| 288 | + with: |
| 289 | + dependencies: "${{ matrix.dependencies }}" |
| 290 | + |
| 291 | + - name: "Run mutation tests with Xdebug and infection/infection" |
| 292 | + env: |
| 293 | + XDEBUG_MODE: "coverage" |
| 294 | + run: "vendor/bin/infection --ansi --configuration=infection.json --logger-github" |
| 295 | + |
| 296 | + performance-tests: |
| 297 | + name: "Performance Tests" |
| 298 | + |
| 299 | + runs-on: "ubuntu-latest" |
| 300 | + |
| 301 | + strategy: |
| 302 | + matrix: |
| 303 | + php-version: |
| 304 | + - "8.3" |
| 305 | + |
| 306 | + dependencies: |
| 307 | + - "locked" |
| 308 | + |
| 309 | + steps: |
| 310 | + - name: "Checkout" |
| 311 | + uses: "actions/checkout@v3.3.0" |
| 312 | + |
| 313 | + - name: "Set up PHP" |
| 314 | + uses: "shivammathur/setup-php@2.24.0" |
| 315 | + with: |
| 316 | + coverage: "none" |
| 317 | + extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter" |
| 318 | + php-version: "${{ matrix.php-version }}" |
| 319 | + |
| 320 | + - name: "Set up problem matchers for PHP" |
| 321 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" |
| 322 | + |
| 323 | + - name: "Determine composer cache directory" |
| 324 | + uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.8.0" |
| 325 | + |
| 326 | + - name: "Cache dependencies installed with composer" |
| 327 | + uses: "actions/cache@v3.2.6" |
| 328 | + with: |
| 329 | + path: "${{ env.COMPOSER_CACHE_DIR }}" |
| 330 | + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" |
| 331 | + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" |
| 332 | + |
| 333 | + - name: "Install ${{ matrix.dependencies }} dependencies with composer" |
| 334 | + uses: "ergebnis/.github/actions/composer/install@1.8.0" |
| 335 | + with: |
| 336 | + dependencies: "${{ matrix.dependencies }}" |
| 337 | + |
| 338 | + - name: "Run performance tests with phpbench/phpbench" |
| 339 | + run: "vendor/bin/phpbench run --config=phpbench.json src/" |
| 340 | + |
193 | 341 | refactoring: |
194 | 342 | name: "Refactoring" |
195 | 343 |
|
@@ -354,3 +502,53 @@ jobs: |
354 | 502 |
|
355 | 503 | - name: "Run vimeo/psalm" |
356 | 504 | run: "vendor/bin/psalm --config=psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4" |
| 505 | + |
| 506 | + tests: |
| 507 | + name: "Tests" |
| 508 | + |
| 509 | + runs-on: "ubuntu-latest" |
| 510 | + |
| 511 | + strategy: |
| 512 | + matrix: |
| 513 | + php-version: |
| 514 | + - "8.3" |
| 515 | + |
| 516 | + dependencies: |
| 517 | + - "lowest" |
| 518 | + - "locked" |
| 519 | + - "highest" |
| 520 | + |
| 521 | + steps: |
| 522 | + - name: "Checkout" |
| 523 | + uses: "actions/checkout@v3.3.0" |
| 524 | + |
| 525 | + - name: "Set up PHP" |
| 526 | + uses: "shivammathur/setup-php@2.24.0" |
| 527 | + with: |
| 528 | + coverage: "none" |
| 529 | + extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter" |
| 530 | + php-version: "${{ matrix.php-version }}" |
| 531 | + |
| 532 | + - name: "Set up problem matchers for PHP" |
| 533 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" |
| 534 | + |
| 535 | + - name: "Set up problem matchers for phpunit/phpunit" |
| 536 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"" |
| 537 | + |
| 538 | + - name: "Determine composer cache directory" |
| 539 | + uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.8.0" |
| 540 | + |
| 541 | + - name: "Cache dependencies installed with composer" |
| 542 | + uses: "actions/cache@v3.2.6" |
| 543 | + with: |
| 544 | + path: "${{ env.COMPOSER_CACHE_DIR }}" |
| 545 | + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" |
| 546 | + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" |
| 547 | + |
| 548 | + - name: "Install ${{ matrix.dependencies }} dependencies with composer" |
| 549 | + uses: "ergebnis/.github/actions/composer/install@1.8.0" |
| 550 | + with: |
| 551 | + dependencies: "${{ matrix.dependencies }}" |
| 552 | + |
| 553 | + - name: "Run tests with phpunit/phpunit" |
| 554 | + run: "vendor/bin/phpunit --colors=always --configuration=phpunit.xml" |
0 commit comments