From 1811ba1d38c6a7afdaa240550031ba32f8d9f585 Mon Sep 17 00:00:00 2001 From: Nextcloud bot Date: Wed, 12 Nov 2025 10:35:37 +0000 Subject: [PATCH] ci: update all workflow templates from organization template repository Signed-off-by: Nextcloud bot --- .github/workflows/lint-php.yml | 39 +++++++++++++++-------- .github/workflows/psalm.yml | 56 ++++++++++++++++++++++------------ 2 files changed, 62 insertions(+), 33 deletions(-) diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml index 81ada6da..ae487584 100644 --- a/.github/workflows/lint-php.yml +++ b/.github/workflows/lint-php.yml @@ -2,18 +2,13 @@ # # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT name: Lint php -on: - pull_request: - paths: - - 'php/**' - push: - branches: - - main - paths: - - 'php/**' +on: pull_request permissions: contents: read @@ -23,29 +18,47 @@ concurrency: cancel-in-progress: true jobs: + matrix: + runs-on: ubuntu-latest-low + outputs: + php-versions: ${{ steps.versions.outputs.php-versions }} + steps: + - name: Checkout app + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + + - name: Get version matrix + id: versions + uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0 + php-lint: runs-on: ubuntu-latest + needs: matrix strategy: matrix: - php-versions: [ "8.4" ] + php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}} name: php-lint steps: - name: Checkout - uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.1.1 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2 + uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 with: 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 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Lint - run: cd php && composer run lint + run: composer run lint summary: permissions: diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 3fcdae12..3059026e 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -2,23 +2,21 @@ # # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT name: Static analysis -on: - pull_request: - paths: - - 'php/**' - push: - branches: - - main - paths: - - 'php/**' +on: pull_request concurrency: group: psalm-${{ github.head_ref || github.run_id }} cancel-in-progress: true +permissions: + contents: read + jobs: static-analysis: runs-on: ubuntu-latest @@ -26,21 +24,39 @@ jobs: name: static-psalm-analysis steps: - name: Checkout - uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.1.1 - - - name: Set up php - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: - php-version: 8.4 - extensions: apcu + persist-credentials: false + + - name: Get php version + 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 + + - name: Set up php${{ steps.versions.outputs.php-available }} + uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 + with: + 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 + # Temporary workaround for missing pcntl_* in PHP 8.3 + ini-values: disable_functions= env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install dependencies and run psalm + - name: Install dependencies run: | - set -x - cd php - composer install - composer run psalm + composer remove nextcloud/ocp --dev --no-scripts + composer i + + - name: Check for vulnerable PHP dependencies + run: composer require --dev roave/security-advisories:dev-latest + + - name: Install nextcloud/ocp + run: composer require --dev nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} --ignore-platform-reqs --with-dependencies + + - name: Run coding standards check + run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github