Skip to content

Commit 70cd9bd

Browse files
slashrsmJanez Urevc
andauthored
CI: modernize GitHub Actions (PHP 8.2–8.5) (#11)
Phase 0 housekeeping: - Upgrade actions/checkout and actions/cache to v4 - Test on PHP 8.2–8.5 - Remove Scrutinizer coverage upload - Fail the suite on test errors (no continue-on-error) Co-authored-by: Janez Urevc <janez@example.com>
1 parent 707d0fb commit 70cd9bd

1 file changed

Lines changed: 16 additions & 22 deletions

File tree

.github/workflows/test.yml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,42 @@ on:
66
pull_request:
77
branches: [ master ]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
test:
1114
strategy:
15+
fail-fast: false
1216
matrix:
13-
php-versions: [ '7.4', '8.0', '8.1' ]
14-
include:
15-
- php-versions: '7.4'
16-
coverage: pcov
17-
composer-prefer: '--prefer-lowest --prefer-stable'
18-
phpunit-flags: '--coverage-clover coverage.xml'
17+
php-versions: [ '8.2', '8.3', '8.4', '8.5' ]
1918

2019
runs-on: ubuntu-latest
2120

2221
steps:
23-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
2423

2524
- name: Set up PHP
2625
uses: shivammathur/setup-php@v2
2726
with:
2827
php-version: ${{ matrix.php-versions }}
29-
coverage: ${{ matrix.coverage }}
28+
coverage: none
29+
tools: composer:v2
30+
3031

31-
- name: Validate composer.json and composer.lock
32-
run: composer validate --strict
32+
- name: Validate composer.json
33+
run: composer validate --strict --no-check-lock
3334

3435
- name: Cache Composer packages
35-
id: composer-cache
36-
uses: actions/cache@v2
36+
uses: actions/cache@v4
3737
with:
3838
path: vendor
39-
key: ${{ runner.os }}-composer-${{ matrix.composer-prefer }}$-${{ hashFiles('**/composer.lock') }}
39+
key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.json') }}
4040
restore-keys: |
41-
${{ runner.os }}-composer-${{ matrix.composer-prefer }}-
41+
${{ runner.os }}-composer-${{ matrix.php-versions }}-
4242
4343
- name: Install dependencies
44-
run: composer update --prefer-dist --no-progress ${{ matrix.composer-prefer }}
44+
run: composer update --prefer-dist --no-progress
4545

4646
- name: Run test suite
47-
run: vendor/bin/phpunit ${{ matrix.phpunit-flags }}
48-
49-
- name: Upload coverage
50-
if: matrix.coverage
51-
run: |
52-
wget https://scrutinizer-ci.com/ocular.phar
53-
php ocular.phar code-coverage:upload --format=php-clover coverage.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}
47+
run: vendor/bin/phpunit

0 commit comments

Comments
 (0)