Skip to content

Commit f67872b

Browse files
committed
Improve the test CI
1 parent 906638c commit f67872b

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

.github/workflows/tests.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,42 @@ jobs:
99
test-php:
1010
name: Test on php ${{ matrix.php-version }} and ${{ matrix.os }}
1111
runs-on: ${{ matrix.os }}
12+
continue-on-error: ${{ matrix.experimental }}
1213
strategy:
1314
fail-fast: false
1415
matrix:
15-
php-version: ["8.1", "8.2", "8.3"]
16+
php-version: ["8.1", "8.2", "8.3", "8.4"]
1617
os: [ubuntu-latest]
18+
experimental: [false]
19+
coverage-required: [true]
20+
composer-options: ['']
21+
include:
22+
- { php-version: 'nightly', experimental: true, os: ubuntu-latest, composer-options: '--ignore-platform-reqs' }
1723
steps:
1824
- uses: actions/checkout@v4
1925
- name: Use php ${{ matrix.php-version }}
2026
uses: shivammathur/setup-php@v2
2127
with:
2228
php-version: ${{ matrix.php-version }}
23-
- name: Cache module
24-
uses: actions/cache@v3
29+
coverage: pcov
30+
- name: Get Composer Cache Directory
31+
id: composer-cache
32+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
33+
- name: Restore cache
34+
uses: actions/cache@v4
2535
with:
26-
path: ~/.composer/cache/
27-
key: composer-cache
36+
path: ${{ steps.composer-cache.outputs.dir }}
37+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-composer-
2840
- name: Install dependencies
29-
run: composer install --no-interaction
41+
run: composer install --no-interaction ${{ matrix.composer-options }}
3042
- name: Run php tests
3143
run: composer run phpunit
3244
- name: Send coverage
33-
uses: codecov/codecov-action@v3
45+
uses: codecov/codecov-action@v4
3446
with:
35-
file: "./build/logs/clover.xml"
47+
fail_ci_if_error: ${{ matrix.coverage-required }}
48+
flags: php-${{ matrix.php-version }}
49+
token: ${{ secrets.CODECOV_TOKEN }}
50+
file: ./build/logs/clover.xml

0 commit comments

Comments
 (0)