@@ -14,31 +14,140 @@ on: # yamllint disable-line rule:truthy
1414 workflow_dispatch :
1515
1616jobs :
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']
23+
24+ uses : simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.9.2
25+ with :
26+ php-version : ${{ matrix.php-version }}
27+
1728 linter :
18- name : Linter
19- runs-on : ['ubuntu-latest']
29+ name : ' Linter'
30+ strategy :
31+ fail-fast : false
32+
33+ uses : simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.9.2
34+ with :
35+ enable_eslinter : false
36+ enable_jsonlinter : true
37+ enable_stylelinter : true
38+ enable_yamllinter : true
39+
40+ unit-tests-linux :
41+ name : " Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
42+ runs-on : ${{ matrix.operating-system }}
43+ needs : [phplinter, linter]
44+ strategy :
45+ fail-fast : false
46+ matrix :
47+ operating-system : [ubuntu-latest]
48+ php-versions : ['8.1', '8.2', '8.3', '8.4']
2049
2150 steps :
51+ - name : Setup PHP, with composer and extensions
52+ # https://github.com/shivammathur/setup-php
53+ uses : shivammathur/setup-php@v2
54+ with :
55+ php-version : ${{ matrix.php-versions }}
56+ extensions : ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml
57+ tools : composer
58+ ini-values : error_reporting=E_ALL
59+ coverage : pcov
60+
61+ - name : Setup problem matchers for PHP
62+ run : echo "::add-matcher::${{ runner.tool_cache }}/php.json"
63+
64+ - name : Setup problem matchers for PHPUnit
65+ run : echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
66+
67+ - name : Set git to use LF
68+ run : |
69+ git config --global core.autocrlf false
70+ git config --global core.eol lf
71+
2272 - uses : actions/checkout@v4
73+
74+ - name : Get composer cache directory
75+ run : echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
76+
77+ - name : Cache composer dependencies
78+ uses : actions/cache@v4
2379 with :
24- fetch-depth : 0
25-
26- - name : Lint Code Base
27- uses : super-linter/super-linter/slim@v7
28- env :
29- SAVE_SUPER_LINTER_OUTPUT : false
30- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
31- LINTER_RULES_PATH : ' tools/linters'
32- LOG_LEVEL : NOTICE
33- VALIDATE_ALL_CODEBASE : true
34- VALIDATE_CSS : true
35- VALIDATE_JAVASCRIPT_ES : true
36- VALIDATE_JSON : true
37- VALIDATE_PHP_BUILTIN : true
38- VALIDATE_YAML : true
39- VALIDATE_XML : true
40- VALIDATE_GITHUB_ACTIONS : true
41- FILTER_REGEX_EXCLUDE : .*public/assets/css/ui-theme-1.13.2/jquery-ui.min.css
80+ path : $COMPOSER_CACHE
81+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
82+ restore-keys : ${{ runner.os }}-composer-
83+
84+ - name : Install Composer dependencies
85+ run : composer install --no-progress --prefer-dist --optimize-autoloader
86+
87+ - name : Run unit tests with coverage
88+ if : ${{ matrix.php-versions == '8.4' }}
89+ run : vendor/bin/phpunit
90+
91+ - name : Run unit tests (no coverage)
92+ if : ${{ matrix.php-versions != '8.4' }}
93+ run : vendor/bin/phpunit --no-coverage
94+
95+ - name : Save coverage data
96+ if : ${{ matrix.php-versions == '8.4' }}
97+ uses : actions/upload-artifact@v4
98+ with :
99+ name : coverage-data
100+ path : ${{ github.workspace }}/build
101+
102+ unit-tests-windows :
103+ name : " Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
104+ runs-on : ${{ matrix.operating-system }}
105+ needs : [phplinter, linter]
106+ strategy :
107+ fail-fast : true
108+ matrix :
109+ operating-system : [windows-latest]
110+ php-versions : ['8.1', '8.2', '8.3', '8.4']
111+
112+ steps :
113+ - name : Setup PHP, with composer and extensions
114+ # https://github.com/shivammathur/setup-php
115+ uses : shivammathur/setup-php@v2
116+ with :
117+ php-version : ${{ matrix.php-versions }}
118+ extensions : ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml
119+ tools : composer
120+ ini-values : error_reporting=E_ALL
121+ coverage : none
122+
123+ - name : Setup problem matchers for PHP
124+ run : echo "::add-matcher::${{ runner.tool_cache }}/php.json"
125+
126+ - name : Setup problem matchers for PHPUnit
127+ run : echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
128+
129+ - name : Set git to use LF
130+ run : |
131+ git config --global core.autocrlf false
132+ git config --global core.eol lf
133+
134+ - uses : actions/checkout@v4
135+
136+ - name : Get composer cache directory
137+ run : echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV"
138+
139+ - name : Cache composer dependencies
140+ uses : actions/cache@v4
141+ with :
142+ path : $COMPOSER_CACHE
143+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
144+ restore-keys : ${{ runner.os }}-composer-
145+
146+ - name : Install Composer dependencies
147+ run : composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req=ext-posix
148+
149+ - name : Run unit tests
150+ run : vendor/bin/phpunit --no-coverage
42151
43152 quality :
44153 name : Quality control
51160 uses : shivammathur/setup-php@v2
52161 with :
53162 # Should be the higest supported version, so we can use the newest tools
54- php-version : ' 8.3 '
163+ php-version : ' 8.4 '
55164 tools : composer, composer-require-checker, composer-unused, phpcs, psalm
56165 # optional performance gain for psalm: opcache
57166 extensions : ctype, date, dom, fileinfo, filter, hash, intl, mbstring, opcache, openssl, pcre, posix, spl, xml
@@ -149,118 +258,6 @@ jobs:
149258 - name : Security check for updated dependencies
150259 run : composer audit
151260
152- unit-tests-linux :
153- name : " Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
154- runs-on : ${{ matrix.operating-system }}
155- needs : [linter, quality, security]
156- strategy :
157- fail-fast : false
158- matrix :
159- operating-system : [ubuntu-latest]
160- php-versions : ['8.1', '8.2', '8.3']
161-
162- steps :
163- - name : Setup PHP, with composer and extensions
164- # https://github.com/shivammathur/setup-php
165- uses : shivammathur/setup-php@v2
166- with :
167- php-version : ${{ matrix.php-versions }}
168- extensions : ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml
169- tools : composer
170- ini-values : error_reporting=E_ALL
171- coverage : pcov
172-
173- - name : Setup problem matchers for PHP
174- run : echo "::add-matcher::${{ runner.tool_cache }}/php.json"
175-
176- - name : Setup problem matchers for PHPUnit
177- run : echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
178-
179- - name : Set git to use LF
180- run : |
181- git config --global core.autocrlf false
182- git config --global core.eol lf
183-
184- - uses : actions/checkout@v4
185-
186- - name : Get composer cache directory
187- run : echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
188-
189- - name : Cache composer dependencies
190- uses : actions/cache@v4
191- with :
192- path : $COMPOSER_CACHE
193- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
194- restore-keys : ${{ runner.os }}-composer-
195-
196- - name : Install Composer dependencies
197- run : composer install --no-progress --prefer-dist --optimize-autoloader
198-
199- - name : Run unit tests with coverage
200- if : ${{ matrix.php-versions == '8.3' }}
201- run : vendor/bin/phpunit
202-
203- - name : Run unit tests (no coverage)
204- if : ${{ matrix.php-versions != '8.3' }}
205- run : vendor/bin/phpunit --no-coverage
206-
207- - name : Save coverage data
208- if : ${{ matrix.php-versions == '8.3' }}
209- uses : actions/upload-artifact@v4
210- with :
211- name : coverage-data
212- path : ${{ github.workspace }}/build
213-
214- unit-tests-windows :
215- name : " Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
216- runs-on : ${{ matrix.operating-system }}
217- needs : [linter, quality, security]
218- strategy :
219- fail-fast : true
220- matrix :
221- operating-system : [windows-latest]
222- php-versions : ['8.1', '8.2', '8.3']
223-
224- steps :
225- - name : Setup PHP, with composer and extensions
226- # https://github.com/shivammathur/setup-php
227- uses : shivammathur/setup-php@v2
228- with :
229- php-version : ${{ matrix.php-versions }}
230- extensions : ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml
231- tools : composer
232- ini-values : error_reporting=E_ALL
233- coverage : none
234-
235- - name : Setup problem matchers for PHP
236- run : echo "::add-matcher::${{ runner.tool_cache }}/php.json"
237-
238- - name : Setup problem matchers for PHPUnit
239- run : echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
240-
241- - name : Set git to use LF
242- run : |
243- git config --global core.autocrlf false
244- git config --global core.eol lf
245-
246- - uses : actions/checkout@v4
247-
248- - name : Get composer cache directory
249- run : echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV"
250-
251- - name : Cache composer dependencies
252- uses : actions/cache@v4
253- with :
254- path : $COMPOSER_CACHE
255- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
256- restore-keys : ${{ runner.os }}-composer-
257-
258- - name : Install Composer dependencies
259- run : composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req=ext-posix
260-
261- - name : Run unit tests
262- run : vendor/bin/phpunit --no-coverage
263-
264261 coverage :
265262 name : Code coverage
266263 runs-on : [ubuntu-latest]
0 commit comments