@@ -14,132 +14,33 @@ on: # yamllint disable-line rule:truthy
1414 workflow_dispatch :
1515
1616jobs :
17- linter :
18- name : Linter
19- runs-on : ['ubuntu-latest']
20-
21- steps :
22- - uses : actions/checkout@v4
23- with :
24- # super-linter needs the full git history to get the
25- # list of files that changed across commits
26- fetch-depth : 0
27-
28- - name : Lint Code Base
29- uses : super-linter/super-linter/slim@v7
30- env :
31- # To report GitHub Actions status checks
32- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
33- LINTER_RULES_PATH : ' tools/linters'
34- LOG_LEVEL : NOTICE
35- VALIDATE_ALL_CODEBASE : true
36- VALIDATE_BASH : true
37- VALIDATE_BASH_EXEC : true
38- VALIDATE_JSON : true
39- VALIDATE_PHP_BUILTIN : true
40- VALIDATE_YAML : true
41- VALIDATE_XML : true
42- VALIDATE_GITHUB_ACTIONS : true
43-
44- quality :
45- name : Quality control
46- runs-on : [ubuntu-latest]
47-
48- steps :
49- - name : Setup PHP, with composer and extensions
50- id : setup-php
51- # https://github.com/shivammathur/setup-php
52- uses : shivammathur/setup-php@v2
53- with :
54- # Should be the higest supported version, so we can use the newest tools
55- php-version : ' 8.4'
56- tools : composer, composer-require-checker, composer-unused, phpcs
57- extensions : ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml
58- coverage : none
59-
60- - name : Setup problem matchers for PHP
61- run : echo "::add-matcher::${{ runner.tool_cache }}/php.json"
62-
63- - uses : actions/checkout@v4
64-
65- - name : Get composer cache directory
66- run : echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
67-
68- - name : Cache composer dependencies
69- uses : actions/cache@v4
70- with :
71- path : $COMPOSER_CACHE
72- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
73- restore-keys : ${{ runner.os }}-composer-
74-
75- - name : Validate composer.json and composer.lock
76- run : composer validate
77-
78- - name : Install Composer dependencies
79- run : composer install --no-progress --prefer-dist --optimize-autoloader
80-
81- - name : Check code for hard dependencies missing in composer.json
82- run : composer-require-checker check composer.json
83-
84- - name : Check code for unused dependencies in composer.json
85- run : composer-unused
86-
87- - name : PHP Code Sniffer
88- run : phpcs
89-
90- - name : PHPStan
91- run : |
92- vendor/bin/phpstan analyze -c phpstan.neon
93-
94- - name : PHPStan (testsuite)
95- run : |
96- vendor/bin/phpstan analyze -c phpstan-dev.neon
97-
98- security :
99- name : Security checks
100- runs-on : [ubuntu-latest]
101- steps :
102- - name : Setup PHP, with composer and extensions
103- # https://github.com/shivammathur/setup-php
104- uses : shivammathur/setup-php@v2
105- with :
106- # Should be the lowest supported version
107- php-version : ' 8.1'
108- extensions : ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml
109- tools : composer
110- coverage : none
111-
112- - name : Setup problem matchers for PHP
113- run : echo "::add-matcher::${{ runner.tool_cache }}/php.json"
114-
115- - uses : actions/checkout@v4
116-
117- - name : Get composer cache directory
118- run : echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
119-
120- - name : Cache composer dependencies
121- uses : actions/cache@v4
122- with :
123- path : $COMPOSER_CACHE
124- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
125- restore-keys : ${{ runner.os }}-composer-
126-
127- - name : Install Composer dependencies
128- run : composer install --no-progress --prefer-dist --optimize-autoloader
17+ phplinter :
18+ name : ' PHP-Linter'
19+ strategy :
20+ fail-fast : false
21+ matrix :
22+ php-version : ['8.1', '8.2', '8.3', '8.4']
12923
130- - name : Security check for locked dependencies
131- run : composer audit
24+ uses :
simplesamlphp/simplesamlphp-test-framework/.github/workflows/[email protected] 25+ with :
26+ php-version : ${{ matrix.php-version }}
13227
133- - name : Update Composer dependencies
134- run : composer update --no-progress --prefer-dist --optimize-autoloader
28+ linter :
29+ name : ' Linter'
30+ strategy :
31+ fail-fast : false
13532
136- - name : Security check for updated dependencies
137- run : composer audit
33+ uses :
simplesamlphp/simplesamlphp-test-framework/.github/workflows/[email protected] 34+ with :
35+ enable_eslinter : false
36+ enable_jsonlinter : true
37+ enable_stylelinter : false
38+ enable_yamllinter : true
13839
13940 unit-tests-linux :
14041 name : " Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
14142 runs-on : ${{ matrix.operating-system }}
142- needs : [linter, quality, security ]
43+ needs : [phplinter, linter ]
14344 strategy :
14445 fail-fast : false
14546 matrix :
@@ -204,7 +105,7 @@ jobs:
204105 unit-tests-windows :
205106 name : " Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
206107 runs-on : ${{ matrix.operating-system }}
207- needs : [linter, quality, security ]
108+ needs : [phplinter, linter ]
208109 strategy :
209110 fail-fast : true
210111 matrix :
@@ -254,6 +155,101 @@ jobs:
254155 - name : Run unit tests
255156 run : vendor/bin/phpunit --no-coverage
256157
158+ quality :
159+ name : Quality control
160+ runs-on : [ubuntu-latest]
161+
162+ steps :
163+ - name : Setup PHP, with composer and extensions
164+ id : setup-php
165+ # https://github.com/shivammathur/setup-php
166+ uses : shivammathur/setup-php@v2
167+ with :
168+ # Should be the higest supported version, so we can use the newest tools
169+ php-version : ' 8.4'
170+ tools : composer, composer-require-checker, composer-unused, phpcs
171+ extensions : ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml
172+ coverage : none
173+
174+ - name : Setup problem matchers for PHP
175+ run : echo "::add-matcher::${{ runner.tool_cache }}/php.json"
176+
177+ - uses : actions/checkout@v4
178+
179+ - name : Get composer cache directory
180+ run : echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
181+
182+ - name : Cache composer dependencies
183+ uses : actions/cache@v4
184+ with :
185+ path : $COMPOSER_CACHE
186+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
187+ restore-keys : ${{ runner.os }}-composer-
188+
189+ - name : Validate composer.json and composer.lock
190+ run : composer validate
191+
192+ - name : Install Composer dependencies
193+ run : composer install --no-progress --prefer-dist --optimize-autoloader
194+
195+ - name : Check code for hard dependencies missing in composer.json
196+ run : composer-require-checker check composer.json
197+
198+ - name : Check code for unused dependencies in composer.json
199+ run : composer-unused
200+
201+ - name : PHP Code Sniffer
202+ run : phpcs
203+
204+ - name : PHPStan
205+ run : |
206+ vendor/bin/phpstan analyze -c phpstan.neon
207+
208+ - name : PHPStan (testsuite)
209+ run : |
210+ vendor/bin/phpstan analyze -c phpstan-dev.neon
211+
212+ security :
213+ name : Security checks
214+ runs-on : [ubuntu-latest]
215+ steps :
216+ - name : Setup PHP, with composer and extensions
217+ # https://github.com/shivammathur/setup-php
218+ uses : shivammathur/setup-php@v2
219+ with :
220+ # Should be the lowest supported version
221+ php-version : ' 8.1'
222+ extensions : ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml
223+ tools : composer
224+ coverage : none
225+
226+ - name : Setup problem matchers for PHP
227+ run : echo "::add-matcher::${{ runner.tool_cache }}/php.json"
228+
229+ - uses : actions/checkout@v4
230+
231+ - name : Get composer cache directory
232+ run : echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
233+
234+ - name : Cache composer dependencies
235+ uses : actions/cache@v4
236+ with :
237+ path : $COMPOSER_CACHE
238+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
239+ restore-keys : ${{ runner.os }}-composer-
240+
241+ - name : Install Composer dependencies
242+ run : composer install --no-progress --prefer-dist --optimize-autoloader
243+
244+ - name : Security check for locked dependencies
245+ run : composer audit
246+
247+ - name : Update Composer dependencies
248+ run : composer update --no-progress --prefer-dist --optimize-autoloader
249+
250+ - name : Security check for updated dependencies
251+ run : composer audit
252+
257253 coverage :
258254 name : Code coverage
259255 runs-on : [ubuntu-latest]
0 commit comments