1- ---
21name : build
32on :
43 push : ~
54 pull_request : ~
6-
75jobs :
86 linux_tests :
9- name : PHP on ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.composer- flags }}
7+ name : PHP ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.flags }}
108 runs-on : ubuntu-22.04
9+
1110 strategy :
1211 matrix :
13- php : ['8.1', '8.2', '8.3', '8.4']
12+ php : ['8.1', '8.2', '8.3', '8.4', '8.5' ]
1413 stability : [prefer-lowest, prefer-stable]
14+
1515 include :
16- - php : ' 8.5'
17- flags : " --ignore-platform-req=php"
18- stability : prefer-stable
16+ - php : ' 8.6'
17+ stability : prefer-stable
18+ flags : " --ignore-platform-req=php"
19+ fail-fast : false
20+
1921 steps :
2022 - name : Checkout code
2123 uses : actions/checkout@v4
@@ -26,39 +28,50 @@ jobs:
2628 php-version : ${{ matrix.php }}
2729 coverage : xdebug
2830 tools : composer:v2
29- - name : Check PHP Version
30- run : php -v
3131
3232 - name : Validate composer files
3333 run : composer validate --strict
3434
35- - name : Get Composer Cache Directory
36- id : composer-cache
37- run : |
38- echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
39- - uses : actions/cache@v3
35+ # Cache "vendor" so stable builds skip installation entirely
36+ - name : Cache vendor
37+ uses : actions/cache@v3
4038 with :
41- path : ${{ steps.composer-cache.outputs.dir }}
42- key : ${{ runner.os }}-composer -${{ matrix.stability }}-${{ matrix.flags }}-${{ hashFiles('**/ composer.lock') }}
39+ path : vendor
40+ key : ${{ runner.os }}-vendor -${{ hashFiles('composer.lock') }}
4341 restore-keys : |
44- ${{ runner.os }}-composer-${{ matrix.stability }}-${{ matrix.flags }}-
45- ${{ runner.os }}-composer-
42+ ${{ runner.os }}-vendor-
43+
44+ # INSTALL logic
45+ # 1. STABLE php + STABLE deps → composer install (NO updates)
46+ - name : Install dependencies (install)
47+ if : ${{ matrix.stability == 'prefer-stable' && matrix.php != '8.6' }}
48+ run : composer install --prefer-dist --no-interaction --no-progress
49+
50+ # 2. prefer-lowest → must use composer update
51+ - name : Install dependencies (prefer-lowest)
52+ if : ${{ matrix.stability == 'prefer-lowest' }}
53+ run : composer update --prefer-lowest --prefer-dist --no-interaction --no-progress
4654
47- - name : Install dependencies
48- run : composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress ${{ matrix.flags }}
55+ # 3. PHP 8.6 dev → always update
56+ - name : Install dependencies (nightly)
57+ if : ${{ matrix.php == '8.6' }}
58+ run : composer update --prefer-stable --prefer-dist --no-interaction --no-progress ${{ matrix.flags }}
4959
5060 - name : Run Unit tests with coverage
51- run : composer phpunit -- ${{ matrix.phpunit-flags }}
52- if : ${{ matrix.php != '8.5' }}
61+ if : ${{ matrix.php != '8.5' && matrix.php != '8.6' }}
62+ run : composer phpunit
5363
54- - name : Run Unit tests without coverage
55- run : vendor/bin/phpunit --no-coverage
56- if : ${{ matrix.php == '8.5' }}
64+ - name : Run Unit tests without coverage (nightly)
65+ if : ${{ matrix.php == '8.6' }}
66+ run : composer phpunit:no-coverage
67+ continue-on-error : true
5768
69+ # STATIC ANALYSIS (only once)
5870 - name : Run static analysis
59- run : composer phpstan-build
60- if : ${{ matrix.php == '8.4' && matrix.stability == 'prefer- stable'}}
71+ if : ${{ matrix.php == '8.4' && matrix.stability == 'prefer-stable' }}
72+ run : composer phpstan: stable
6173
74+ # CODING STYLE (only once)
6275 - name : Run Coding style rules
76+ if : ${{ matrix.php == '8.4' && matrix.stability == 'prefer-stable' }}
6377 run : composer phpcs:fix
64- if : ${{ matrix.php == '8.4' && matrix.stability == 'prefer-stable'}}
0 commit comments