Skip to content

Commit 3c98e08

Browse files
committed
make workflow easier to maintain
1 parent ecf652f commit 3c98e08

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/ci.yml

+12-8
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ on:
44
push:
55
branches-ignore: [master]
66

7+
env:
8+
PHP_LOWEST: '8.2'
9+
PHP_LATEST: '8.4'
10+
711
jobs:
812
tests:
9-
name: Tests / PHP ${{ matrix.php }}, ${{ matrix.stability }}
13+
name: Tests / ${{ matrix.version }} PHP, ${{ matrix.stability }}
1014

1115
runs-on: ubuntu-latest
1216
strategy:
1317
matrix:
14-
php: ['8.2', '8.3', '8.4']
18+
version: ['lowest', 'latest']
1519
stability: [prefer-lowest, prefer-stable]
1620

1721
steps:
@@ -21,7 +25,7 @@ jobs:
2125
- name: Setup PHP
2226
uses: shivammathur/setup-php@v2
2327
with:
24-
php-version: ${{ matrix.php }}
28+
php-version: ${{ matrix.version == 'lowest' && env.PHP_LOWEST || env.PHP_LATEST }}
2529
coverage: none
2630

2731
- name: Get Composer cache directory path
@@ -42,15 +46,15 @@ jobs:
4246
run: vendor/bin/phpunit
4347

4448
types:
45-
name: Types / PHP ${{ matrix.php }}
49+
name: Types / ${{ matrix.version }} PHP
4650

4751
runs-on: ubuntu-latest
4852
strategy:
4953
matrix:
5054
include:
51-
- php: '8.2'
55+
- version: lowest
5256
stability: prefer-lowest
53-
- php: '8.4'
57+
- version: latest
5458
stability: prefer-stable
5559

5660
steps:
@@ -60,7 +64,7 @@ jobs:
6064
- name: Setup PHP
6165
uses: shivammathur/setup-php@v2
6266
with:
63-
php-version: ${{ matrix.php }}
67+
php-version: ${{ matrix.version == 'lowest' && env.PHP_LOWEST || env.PHP_LATEST }}
6468
coverage: none
6569

6670
- name: Get Composer cache directory path
@@ -99,7 +103,7 @@ jobs:
99103
- name: Setup PHP
100104
uses: shivammathur/setup-php@v2
101105
with:
102-
php-version: '8.2'
106+
php-version: ${{ env.PHP_LOWEST }}
103107
coverage: none
104108

105109
- name: Get Composer cache directory path

0 commit comments

Comments
 (0)