Skip to content

Commit 4cbf2fc

Browse files
committed
Simplify CI configuration
1 parent ff1753e commit 4cbf2fc

File tree

1 file changed

+23
-26
lines changed

1 file changed

+23
-26
lines changed

.github/workflows/continuous_integration.yml

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,22 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
strategy:
17-
matrix:
18-
install-args: ['', '--prefer-lowest']
19-
php-version: ['7.2', '7.3', '7.4', '8.0', '8.1']
2017
fail-fast: false
18+
matrix:
19+
php-version:
20+
- '7.2'
21+
- '7.3'
22+
- '7.4'
23+
- '8.0'
24+
- '8.1'
25+
dependencies:
26+
- 'highest'
27+
include:
28+
- php-version: '7.2'
29+
dependencies: 'lowest'
30+
- php-version: '8.1'
31+
dependencies: 'lowest'
32+
- php-version: '8.1'
2133

2234
steps:
2335
# Cancel previous runs of the same branch
@@ -32,30 +44,15 @@ jobs:
3244
- name: Install PHP
3345
uses: shivammathur/setup-php@v2
3446
with:
35-
php-version: "${{ matrix.php-version }}"
47+
php-version: '${{ matrix.php-version }}'
3648
tools: composer:v2
3749

38-
- name: composer-cache-dir
39-
id: composercache
40-
run: |
41-
echo "::set-output name=dir::$(composer config cache-files-dir)"
42-
43-
- name: composer-cache
44-
uses: actions/cache@v2
50+
- name: Install dependencies with Composer
51+
uses: ramsey/composer-install@v1
4552
with:
46-
path: ${{ steps.composercache.outputs.dir }}
47-
key: composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }}
48-
restore-keys: |
49-
composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }}
50-
composer-${{ hashFiles('**/composer.json') }}-
51-
composer-
52-
53-
- name: Install dependencies
54-
run: |
55-
composer update ${{ matrix.install-args }} --no-interaction --no-progress --prefer-dist
56-
if: ${{ matrix.php-version != '8.0' }}
53+
dependency-versions: '${{ matrix.dependencies }}'
5754

58-
- name: Run tests with phpunit/phpunit
55+
- name: Run PHPUnit
5956
run: vendor/bin/phpunit
6057

6158
- name: Validate composer
@@ -64,11 +61,11 @@ jobs:
6461
- name: phpstan-cache
6562
uses: actions/cache@v2
6663
with:
67-
key: phpstan-${{ matrix.php-version }}-${{ matrix.install-args }}-${{ github.ref }}-${{ github.sha }}
64+
key: phpstan-${{ matrix.php-version }}-${{ matrix.dependencies }}-${{ github.ref }}-${{ github.sha }}
6865
path: .phpstan-cache
6966
restore-keys: |
70-
phpstan-${{ matrix.php-version }}-${{ matrix.install-args }}-${{ github.ref }}-
71-
phpstan-${{ matrix.php-version }}-${{ matrix.install-args }}-
67+
phpstan-${{ matrix.php-version }}-${{ matrix.dependencies }}-${{ github.ref }}-
68+
phpstan-${{ matrix.php-version }}-${{ matrix.dependencies }}-
7269
phpstan-${{ matrix.php-version }}-
7370
phpstan-
7471

0 commit comments

Comments
 (0)