|
9 | 9 | pull_request:
|
10 | 10 | branches:
|
11 | 11 | - master
|
12 |
| - |
| 12 | +env: |
| 13 | + PHP_MIN: 8.1 |
13 | 14 | jobs:
|
14 | 15 | run:
|
15 | 16 | runs-on: ubuntu-latest
|
16 | 17 | strategy:
|
17 | 18 | matrix:
|
18 |
| - php-versions: ['8.1', '8.2', '8.3'] |
19 |
| - name: PHP ${{ matrix.php-versions }} |
| 19 | + php-version: ['8.1', '8.2', '8.3'] |
| 20 | + composer-flag: ['--prefer-lowest', ''] |
| 21 | + name: PHP ${{ matrix.php-version }} ${{ matrix.composer-flag }} |
20 | 22 | steps:
|
21 | 23 | - name: Checkout
|
22 |
| - uses: actions/checkout@v2 |
| 24 | + uses: actions/checkout@v4 |
23 | 25 |
|
24 | 26 | - name: Setup PHP
|
25 | 27 | uses: shivammathur/setup-php@v2
|
26 | 28 | with:
|
27 |
| - php-version: ${{ matrix.php-versions }} |
| 29 | + php-version: ${{ matrix.php-version }} |
28 | 30 |
|
29 | 31 | - name: Get Composer Cache Directory
|
30 | 32 | id: composer-cache
|
31 | 33 | run: |
|
32 |
| - echo "::set-output name=dir::$(composer config cache-files-dir)" |
33 |
| - - uses: actions/cache@v2 |
| 34 | + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 35 | + - uses: actions/cache@v3 |
34 | 36 | with:
|
35 | 37 | path: ${{ steps.composer-cache.outputs.dir }}
|
36 |
| - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 38 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.composer-flag }} |
37 | 39 | restore-keys: |
|
38 | 40 | ${{ runner.os }}-composer-
|
39 | 41 |
|
40 |
| - - name: Install dependencies |
41 |
| - run: composer install --prefer-dist --dev |
| 42 | + - name: Install dependencies ${{ matrix.composer-flag }} |
| 43 | + run: composer update --prefer-install=dist ${{ matrix.composer-flag }} --dev |
42 | 44 |
|
43 | 45 | - name: Run tests
|
44 | 46 | run: ./vendor/bin/phpunit
|
45 | 47 |
|
46 | 48 | - name: Run rector
|
| 49 | + if: matrix.php-version == env.PHP_MIN && matrix.composer-flag == '' |
47 | 50 | run: ./vendor/bin/rector --dry-run
|
48 | 51 |
|
49 | 52 | - name: Run code style check
|
| 53 | + if: matrix.php-version == env.PHP_MIN && matrix.composer-flag == '' |
50 | 54 | run: ./vendor/bin/ecs
|
0 commit comments