Skip to content

Commit f2a1859

Browse files
committed
chore: run static analysis for each php version
Signed-off-by: Elizabeth Danzberger <[email protected]>
1 parent e48bd48 commit f2a1859

File tree

1 file changed

+35
-7
lines changed

1 file changed

+35
-7
lines changed

.github/workflows/psalm.yml

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,43 @@ permissions:
1818
contents: read
1919

2020
jobs:
21-
static-analysis:
22-
runs-on: ubuntu-latest
23-
24-
name: static-psalm-analysis
21+
matrix:
22+
runs-on: ubuntu-latest-low
23+
outputs:
24+
php-versions: ${{ steps.versions.outputs.php-versions }}
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2828
with:
2929
persist-credentials: false
3030

31-
- name: Get php version
31+
- name: Get php version matrix
3232
id: versions
3333
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
3434

3535
- name: Check enforcement of minimum PHP version ${{ steps.versions.outputs.php-min }} in psalm.xml
3636
run: grep 'phpVersion="${{ steps.versions.outputs.php-min }}' psalm.xml
3737

38-
- name: Set up php${{ steps.versions.outputs.php-min }}
38+
static-analysis:
39+
runs-on: ubuntu-latest
40+
needs: matrix
41+
strategy:
42+
matrix:
43+
fail-fast: false
44+
php-versions: ${{ fromJson(needs.matrix.outputs.php-versions) }}
45+
46+
name: static-psalm-analysis
47+
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
51+
with:
52+
persist-credentials: false
53+
54+
- name: Set up php${{ matrix.php-versions }}
3955
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
4056
with:
41-
php-version: ${{ steps.versions.outputs.php-min }}
57+
php-version: ${{ matrix.php-versions }}
4258
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
4359
coverage: none
4460
ini-file: development
@@ -57,3 +73,15 @@ jobs:
5773

5874
- name: Run coding standards check
5975
run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github
76+
77+
summary:
78+
runs-on: ubuntu-latest-low
79+
needs: static-analysis
80+
81+
if: always()
82+
83+
name: static-analysis-summary
84+
85+
steps:
86+
- name: Summary status
87+
run: if ${{ needs.static-analysis.result != 'success' && needs.static-analysis.result != 'skipped' }}; then exit 1; fi

0 commit comments

Comments
 (0)