|
| 1 | +on: [ push, pull_request ] |
| 2 | +name: "Tests" |
| 3 | + |
| 4 | +jobs: |
| 5 | + grump: |
| 6 | + name: "GrumPHP Run" |
| 7 | + runs-on: "ubuntu-latest" |
| 8 | + continue-on-error: ${{ matrix.allow-fail }} |
| 9 | + env: |
| 10 | + PHP_CS_FIXER_IGNORE_ENV: true |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + include: |
| 14 | + - { php-version: 8.3, dependencies: locked, coverage: pcov, with_coverage: true, allow-fail: false } |
| 15 | + - { php-version: 8.3, dependencies: highest, coverage: none, with_coverage: false, allow-fail: false } |
| 16 | + |
| 17 | + - { php-version: 8.4, dependencies: locked, coverage: none, with_coverage: false, allow-fail: true } |
| 18 | + - { php-version: 8.4, dependencies: highest, coverage: none, with_coverage: false, allow-fail: true } |
| 19 | + steps: |
| 20 | + - name: "Checkout" |
| 21 | + |
| 22 | + |
| 23 | + - name: "Install PHP" |
| 24 | + uses: "shivammathur/[email protected]" |
| 25 | + with: |
| 26 | + coverage: "${{ matrix.coverage }}" |
| 27 | + ini-values: display_errors=On, display_startup_errors=On, error_reporting=32767 |
| 28 | + php-version: "${{ matrix.php-version }}" |
| 29 | + |
| 30 | + - name: "Set up problem matchers for PHP" |
| 31 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" |
| 32 | + |
| 33 | + - name: "Set up problem matchers for phpunit/phpunit" |
| 34 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"" |
| 35 | + |
| 36 | + - name: "Validate composer.json and composer.lock" |
| 37 | + run: "composer validate --ansi --strict" |
| 38 | + |
| 39 | + - name: "Determine composer cache directory" |
| 40 | + uses: "ergebnis/.github/actions/composer/[email protected]" |
| 41 | + |
| 42 | + - name: "Cache dependencies installed with composer" |
| 43 | + |
| 44 | + with: |
| 45 | + path: "${{ env.COMPOSER_CACHE_DIR }}" |
| 46 | + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" |
| 47 | + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" |
| 48 | + |
| 49 | + - name: "Install ${{ matrix.dependencies }} dependencies with composer" |
| 50 | + uses: "ergebnis/.github/actions/composer/[email protected]" |
| 51 | + with: |
| 52 | + dependencies: "${{ matrix.dependencies }}" |
| 53 | + |
| 54 | + - name: "Run GrumPHP" |
| 55 | + run: | |
| 56 | + vendor/bin/codecept build -c . |
| 57 | + vendor/bin/codecept run -c . -vvv --coverage --coverage-xml=coverage.xml --xml |
| 58 | +
|
| 59 | + - name: Coverage Check |
| 60 | + uses: docker://ghcr.io/ericsizemore/phpunit-coverage-check-action |
| 61 | + with: |
| 62 | + clover_file: './build/logs/report.xml' |
| 63 | + threshold: 5 |
0 commit comments