@@ -11,23 +11,28 @@ on: # yamllint disable-line rule:truthy
1111 branches : [master, release-*]
1212 paths-ignore :
1313 - ' **.md'
14+ workflow_dispatch :
1415
1516jobs :
1617 linter :
1718 name : Linter
1819 runs-on : ['ubuntu-latest']
1920
2021 steps :
21- - uses : actions/checkout@v3
22+ - uses : actions/checkout@v4
2223 with :
24+ # super-linter needs the full git history to get the
25+ # list of files that changed across commits
2326 fetch-depth : 0
2427
2528 - name : Lint Code Base
26- uses : github /super-linter/slim@v5
29+ uses : super-linter /super-linter/slim@v6
2730 env :
31+ # To report GitHub Actions status checks
32+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
33+ LINTER_RULES_PATH : ' tools/linters'
2834 LOG_LEVEL : NOTICE
2935 VALIDATE_ALL_CODEBASE : true
30- LINTER_RULES_PATH : ' tools/linters'
3136 VALIDATE_BASH : true
3237 VALIDATE_BASH_EXEC : true
3338 VALIDATE_JSON : true
@@ -47,21 +52,20 @@ jobs:
4752 with :
4853 # Should be the higest supported version, so we can use the newest tools
4954 php-version : ' 8.3'
50- tools : composer, composer-require-checker, composer-unused, phpcs, psalm
51- # optional performance gain for psalm: opcache
52- extensions : ctype, date, dom, filter, hash, mbstring, opcache, openssl, pcre, soap, spl, xml
55+ tools : composer, composer-require-checker, composer-unused, phpcs, phpstan
56+ extensions : ctype, date, dom, filter, hash, mbstring, openssl, pcre, soap, spl, xml
5357 coverage : none
5458
5559 - name : Setup problem matchers for PHP
5660 run : echo "::add-matcher::${{ runner.tool_cache }}/php.json"
5761
58- - uses : actions/checkout@v3
62+ - uses : actions/checkout@v4
5963
6064 - name : Get composer cache directory
6165 run : echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
6266
6367 - name : Cache composer dependencies
64- uses : actions/cache@v3
68+ uses : actions/cache@v4
6569 with :
6670 path : $COMPOSER_CACHE
6771 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -83,28 +87,13 @@ jobs:
8387 - name : PHP Code Sniffer
8488 run : phpcs
8589
86- - name : Psalm
87- continue-on-error : true
88- run : |
89- psalm -c psalm.xml \
90- --show-info=true \
91- --shepherd \
92- --php-version=${{ steps.setup-php.outputs.php-version }}
93-
94- - name : Psalm (testsuite)
95- continue-on-error : true
90+ - name : PHPStan
9691 run : |
97- psalm -c psalm-dev.xml \
98- --show-info=true \
99- --shepherd \
100- --php-version=${{ steps.setup-php.outputs.php-version }}
92+ phpstan analyze -c phpstan.neon
10193
102- - name : Psalter
94+ - name : PHPStan (testsuite)
10395 run : |
104- psalm --alter \
105- --issues=UnnecessaryVarAnnotation \
106- --dry-run \
107- --php-version=${{ steps.setup-php.outputs.php-version }}
96+ phpstan analyze -c phpstan-dev.neon
10897
10998 security :
11099 name : Security checks
@@ -123,13 +112,13 @@ jobs:
123112 - name : Setup problem matchers for PHP
124113 run : echo "::add-matcher::${{ runner.tool_cache }}/php.json"
125114
126- - uses : actions/checkout@v3
115+ - uses : actions/checkout@v4
127116
128117 - name : Get composer cache directory
129118 run : echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
130119
131120 - name : Cache composer dependencies
132- uses : actions/cache@v3
121+ uses : actions/cache@v4
133122 with :
134123 path : $COMPOSER_CACHE
135124 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -179,13 +168,13 @@ jobs:
179168 git config --global core.autocrlf false
180169 git config --global core.eol lf
181170
182- - uses : actions/checkout@v3
171+ - uses : actions/checkout@v4
183172
184173 - name : Get composer cache directory
185174 run : echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
186175
187176 - name : Cache composer dependencies
188- uses : actions/cache@v3
177+ uses : actions/cache@v4
189178 with :
190179 path : $COMPOSER_CACHE
191180 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -204,7 +193,7 @@ jobs:
204193
205194 - name : Save coverage data
206195 if : ${{ matrix.php-versions == '8.3' }}
207- uses : actions/upload-artifact@v3
196+ uses : actions/upload-artifact@v4
208197 with :
209198 name : coverage-data
210199 path : ${{ github.workspace }}/build
@@ -241,13 +230,13 @@ jobs:
241230 git config --global core.autocrlf false
242231 git config --global core.eol lf
243232
244- - uses : actions/checkout@v3
233+ - uses : actions/checkout@v4
245234
246235 - name : Get composer cache directory
247236 run : echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV"
248237
249238 - name : Cache composer dependencies
250- uses : actions/cache@v3
239+ uses : actions/cache@v4
251240 with :
252241 path : $COMPOSER_CACHE
253242 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -264,16 +253,30 @@ jobs:
264253 runs-on : [ubuntu-latest]
265254 needs : [unit-tests-linux]
266255 steps :
267- - uses : actions/checkout@v3
256+ - uses : actions/checkout@v4
268257
269- - uses : actions/download-artifact@v3
258+ - uses : actions/download-artifact@v4
270259 with :
271260 name : coverage-data
272261 path : ${{ github.workspace }}/build
273262
274263 - name : Codecov
275- uses : codecov/codecov-action@v3
264+ uses : codecov/codecov-action@v4
276265 with :
277266 token : ${{ secrets.CODECOV_TOKEN }}
278267 fail_ci_if_error : true
279268 verbose : true
269+
270+ cleanup :
271+ name : Cleanup artifacts
272+ needs : [unit-tests-linux, coverage]
273+ runs-on : [ubuntu-latest]
274+ if : |
275+ always() &&
276+ needs.coverage.result == 'success' ||
277+ (needs.unit-tests-linux == 'success' && needs.coverage == 'skipped')
278+
279+ steps :
280+ - uses : geekyeggo/delete-artifact@v5
281+ with :
282+ name : coverage-data
0 commit comments