@@ -2,80 +2,86 @@ name: CI
22
33on :
44 push :
5+ branches : [main]
56 pull_request :
7+ branches : [main]
68 release :
7- types :
8- - published
9+ types : [published]
910
1011jobs :
11- php-tests :
12- runs-on : ${{ matrix.os }}
12+ # ###############################################################################
13+ # LINTING JOB: Runs once to check for code style issues.
14+ # ###############################################################################
15+ lint :
16+ name : " PHP Linting"
17+ runs-on : ubuntu-latest
18+ steps :
19+ - name : Checkout Code
20+ uses : actions/checkout@v6
21+
22+ - name : Setup PHP
23+ uses : shivammathur/setup-php@v2
24+ with :
25+ php-version : 8.4
26+ tools : composer:v2
27+
28+ - name : Cache Composer dependencies
29+ uses : actions/cache@v5
30+ with :
31+ path : vendor
32+ key : ubuntu-php-8.4-lint-${{ hashFiles('**/composer.lock') }}
33+ restore-keys : |
34+ ubuntu-php-8.4-lint-
35+
36+ - name : Install Dependencies
37+ uses : ramsey/composer-install@v4
38+
39+ - name : Execute linter (Pint)
40+ run : composer lint
41+
42+ # ###############################################################################
43+ # TESTING JOB: Runs tests and handles coverage reporting.
44+ # ###############################################################################
45+ tests :
46+ name : " P${{ matrix.php }} | L${{ matrix.laravel }}"
47+ needs : lint
48+ runs-on : ubuntu-latest
1349
1450 strategy :
1551 fail-fast : false
1652 matrix :
1753 php : [8.4]
18- laravel : [10.*, 11.*, 12.*]
19- os : [ubuntu-latest]
20- coverage : [none]
21- include :
22- - php : 8.4
23- laravel : 12.*
24- os : ubuntu-latest
25- coverage : xdebug
26-
27- name : ' [P${{ matrix.php }}] [L${{ matrix.laravel }}] [${{ matrix.coverage }}]'
54+ laravel : [12.*] # Matrix is kept to L12 due to PHP 8.4 requirement
2855
2956 steps :
3057 - name : Checkout Code
31- uses : actions/checkout@v5
58+ uses : actions/checkout@v6
3259
3360 - name : Setup PHP
3461 uses : shivammathur/setup-php@v2
3562 with :
3663 php-version : ${{ matrix.php }}
37- extensions : mbstring json openssl xdebug
38- ini-values : memory_limit=-1
39- tools : composer:v2
40- coverage : ${{ matrix.coverage }}
41- env :
42- update : true
64+ extensions : mbstring, json, openssl, iconv
65+ coverage : xdebug
4366
44- - name : Cache dependencies
45- uses : actions/cache@v4
67+ - name : Cache Composer dependencies
68+ uses : actions/cache@v5
4669 with :
4770 path : vendor
48- key : ${{ matrix.os }}-${{ matrix.php }}-${{ matrix.laravel }}-vendor-${{ hashFiles('**/composer.lock') }}
71+ key : ubuntu-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }}
72+ restore-keys : |
73+ ubuntu-${{ matrix.php }}-${{ matrix.laravel }}-
4974
5075 - name : Install Dependencies
51- uses : ramsey/composer-install@v3
76+ uses : ramsey/composer-install@v4
5277
53- - name : Execute tests (Unit and Feature tests) via PHPUnit
54- if : matrix.coverage == 'none'
55- run : composer test
56-
57- - name : Run code style check
58- if : matrix.coverage == 'xdebug'
59- run : composer check
60-
61- - name : Run code analyze
62- if : matrix.coverage == 'xdebug'
63- run : composer analyze
64-
65- - name : Execute tests (Unit and Feature tests) via PHPUnit
66- if : matrix.coverage == 'xdebug'
78+ - name : Execute tests (PHPUnit)
6779 run : composer test-ci
6880
69- - name : Upload coverage reports to Codecov
70- if : matrix.coverage == 'xdebug'
71- uses : codecov/codecov-action@v5
72- with :
73- token : ${{ secrets.CODECOV_TOKEN }}
74- slug : ${{ github.repository }}
81+ - name : Upload coverage to Codecov
82+ if : matrix.php == '8.4' && matrix.laravel == '12.*'
83+ uses : codecov/codecov-action@v6
7584
7685 - name : Upload test results to Codecov
77- if : matrix.coverage == 'xdebug'
78- uses : codecov/test-results-action@v1
79- with :
80- token : ${{ secrets.CODECOV_TOKEN }}
81- slug : ${{ github.repository }}
86+ if : matrix.php == '8.4' && matrix.laravel == '12.*'
87+ uses : codecov/test-results-action@v2
0 commit comments