|
1 | 1 | name: CI-coverage |
2 | 2 |
|
3 | | -on: [ push ] |
| 3 | +on: [ push, pull_request ] |
| 4 | + |
| 5 | +permissions: |
| 6 | + contents: read |
4 | 7 |
|
5 | 8 | jobs: |
6 | 9 | test-php: |
7 | | - runs-on: ubuntu-20.04 |
| 10 | + runs-on: ubuntu-latest |
8 | 11 | strategy: |
9 | 12 | fail-fast: true |
10 | 13 | matrix: |
11 | | - php-versions: [ "7.4", "8.0", "8.4" ] |
12 | | - phpunit-versions: [ "9" ] |
| 14 | + php-version: [ "7.4", "8.0", "8.4" ] |
13 | 15 | steps: |
14 | | - - uses: actions/checkout@v2 |
15 | | - - uses: php-actions/composer@v6 |
| 16 | + - uses: actions/checkout@v5 |
| 17 | + |
| 18 | + - name: Set up PHP |
| 19 | + uses: shivammathur/setup-php@v2 |
16 | 20 | with: |
17 | | - php_version: "${{ matrix.php-versions }}" |
18 | | - dev: yes |
19 | | - interaction: no |
20 | | - - name: PHPUnit Tests php |
21 | | - uses: php-actions/phpunit@v2 |
| 21 | + php-version: "${{ matrix.php-version }}" |
| 22 | + extensions: curl, json |
| 23 | + coverage: xdebug |
| 24 | + tools: composer:v2 |
| 25 | + ini-values: xdebug.mode=coverage |
| 26 | + |
| 27 | + - name: Validate Composer files |
| 28 | + run: composer validate --strict |
| 29 | + |
| 30 | + - name: Install dependencies |
| 31 | + uses: ramsey/composer-install@v3 |
22 | 32 | with: |
23 | | - version: "${{ matrix.phpunit-versions }}" |
24 | | - php_version: "${{ matrix.php-versions }}" |
25 | | - php_extensions: xdebug |
26 | | - bootstrap: vendor/autoload.php |
27 | | - configuration: phpunit.xml |
28 | | - args: --coverage-clover=coverage.xml --exclude-group local-only |
| 33 | + composer-options: --no-interaction --prefer-dist |
| 34 | + |
| 35 | + - name: Run PHPUnit |
| 36 | + run: vendor/bin/phpunit --configuration phpunit.xml --coverage-clover=coverage.xml --exclude-group local-only |
29 | 37 | env: |
30 | 38 | XDEBUG_MODE: coverage |
31 | | - - name: Upload to Codecov |
32 | | - uses: codecov/codecov-action@v1 |
| 39 | + |
| 40 | + - name: Upload coverage to Codecov |
| 41 | + if: matrix.php-version == '8.4' |
| 42 | + uses: codecov/codecov-action@v4 |
33 | 43 | with: |
34 | 44 | token: ${{ secrets.CODECOV_TOKEN }} |
35 | | - file: ./coverage.xml |
| 45 | + files: ./coverage.xml |
| 46 | + disable_search: true |
| 47 | + fail_ci_if_error: true |
0 commit comments