From 2d50495d2e674d9ddecdda6d73195042f231b090 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 27 Nov 2024 21:37:28 +0100 Subject: [PATCH] fix(psalm): Enforce that psalm is executed against the minimum PHP version Signed-off-by: Joas Schilling --- workflow-templates/psalm-matrix.yml | 9 ++++++--- workflow-templates/psalm.yml | 7 +++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/workflow-templates/psalm-matrix.yml b/workflow-templates/psalm-matrix.yml index 07c11b8..51f2718 100644 --- a/workflow-templates/psalm-matrix.yml +++ b/workflow-templates/psalm-matrix.yml @@ -19,14 +19,17 @@ jobs: runs-on: ubuntu-latest-low outputs: ocp-matrix: ${{ steps.versions.outputs.ocp-matrix }} - php-min: ${{ steps.versions.outputs.php-min }} steps: - name: Checkout app uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Get version matrix id: versions uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 + - name: Check enforcement of minimum PHP version ${{ steps.versions.outputs.php-min }} in psalm.xml + run: grep 'phpVersion="${{ steps.versions.outputs.php-min }}' psalm.xml + static-analysis: runs-on: ubuntu-latest needs: matrix @@ -40,10 +43,10 @@ jobs: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Set up php${{ needs.matrix.outputs.php-min }} + - name: Set up php${{ matrix.php-versions }} uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 with: - php-version: ${{ needs.matrix.outputs.php-min }} + php-version: ${{ matrix.php-versions }} extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite coverage: none ini-file: development diff --git a/workflow-templates/psalm.yml b/workflow-templates/psalm.yml index ef6ab34..37c3cef 100644 --- a/workflow-templates/psalm.yml +++ b/workflow-templates/psalm.yml @@ -27,10 +27,13 @@ jobs: id: versions uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - - name: Set up php${{ steps.versions.outputs.php-min }} + - name: Check enforcement of minimum PHP version ${{ steps.versions.outputs.php-min }} in psalm.xml + run: grep 'phpVersion="${{ steps.versions.outputs.php-min }}' psalm.xml + + - name: Set up php${{ steps.versions.outputs.php-available }} uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 with: - php-version: ${{ steps.versions.outputs.php-min }} + php-version: ${{ steps.versions.outputs.php-available }} extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite coverage: none ini-file: development