diff --git a/.github/workflows/lint-info-xml.yml b/.github/workflows/lint-info-xml.yml index b4fba6a6..e0372e10 100644 --- a/.github/workflows/lint-info-xml.yml +++ b/.github/workflows/lint-info-xml.yml @@ -1,35 +1,16 @@ -# SPDX-FileCopyrightText: 2026 LibreCode Coop and LibreCode contributors -# +# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors # SPDX-License-Identifier: AGPL-3.0-or-later +# This workflow is published through the LibreCode organization catalog. +# Implementation: LibreCodeCoop/github-workflows + name: Lint info.xml -on: - pull_request: +on: pull_request permissions: contents: read -concurrency: - group: lint-info-xml-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - jobs: - xml-linters: - runs-on: ubuntu-latest - name: info.xml lint - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - name: Download schema - run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd - - - name: Lint info.xml - uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2 - with: - xml-file: ./appinfo/info.xml - xml-schema-file: ./info.xsd + lint-info-xml: + uses: LibreCodeCoop/github-workflows/.github/workflows/lint-info-xml.yml@c5f578281fa7d270b839866ebc07047287ff50d8 diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml index 71437f32..04b650df 100644 --- a/.github/workflows/lint-php-cs.yml +++ b/.github/workflows/lint-php-cs.yml @@ -1,48 +1,16 @@ -# SPDX-FileCopyrightText: 2026 LibreCode Coop and LibreCode contributors -# +# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors # SPDX-License-Identifier: AGPL-3.0-or-later +# This workflow is published through the LibreCode organization catalog. +# Implementation: LibreCodeCoop/github-workflows + name: Lint php-cs -on: - pull_request: +on: pull_request permissions: contents: read -concurrency: - group: lint-php-cs-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - jobs: - lint: - runs-on: ubuntu-latest - name: php-cs - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - name: Get php version - id: versions - uses: icewind1991/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 - - - name: Set up php${{ steps.versions.outputs.php-min }} - uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0 - with: - php-version: ${{ steps.versions.outputs.php-min }} - 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: Install dependencies - run: | - composer remove nextcloud/ocp --dev --no-scripts - composer i - - - name: Lint - run: composer run cs:check || (echo 'Please run `composer run cs:fix` to format your code' && exit 1) + lint-php-cs: + uses: LibreCodeCoop/github-workflows/.github/workflows/lint-php-cs.yml@bc97b54e3d33d58d6075a0994883acde00f0556c diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml index 5f58b5c4..a54876f2 100644 --- a/.github/workflows/lint-php.yml +++ b/.github/workflows/lint-php.yml @@ -1,78 +1,16 @@ -# SPDX-FileCopyrightText: 2026 LibreCode Coop and LibreCode contributors -# +# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors # SPDX-License-Identifier: AGPL-3.0-or-later +# This workflow is published through the LibreCode organization catalog. +# Implementation: LibreCodeCoop/github-workflows + name: Lint php -on: - pull_request: +on: pull_request permissions: contents: read -concurrency: - group: lint-php-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - jobs: - matrix: - runs-on: ubuntu-latest - outputs: - php-min: ${{ steps.versions.outputs.php-min }} - php-max: ${{ steps.versions.outputs.php-max }} - - steps: - - name: Checkout app - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 - - php-lint: - runs-on: ubuntu-latest - needs: matrix - name: php-lint - - strategy: - matrix: - php-versions: ['${{ needs.matrix.outputs.php-min }}', '${{ needs.matrix.outputs.php-max }}'] - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0 - 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: Install dependencies - run: | - composer remove nextcloud/ocp --dev --no-scripts - composer i - - - name: Lint - run: composer run lint - - summary: - permissions: - contents: none - runs-on: ubuntu-latest - needs: php-lint - if: always() - - name: php-lint-summary - - steps: - - name: Summary status - run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi + lint-php: + uses: LibreCodeCoop/github-workflows/.github/workflows/lint-php.yml@bc97b54e3d33d58d6075a0994883acde00f0556c diff --git a/.github/workflows/openapi.yml b/.github/workflows/openapi.yml index 7f31c43b..fa6fdded 100644 --- a/.github/workflows/openapi.yml +++ b/.github/workflows/openapi.yml @@ -1,94 +1,16 @@ -# SPDX-FileCopyrightText: 2026 LibreCode Coop and LibreCode contributors -# +# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors # SPDX-License-Identifier: AGPL-3.0-or-later +# This workflow is published through the LibreCode organization catalog. +# Implementation: LibreCodeCoop/github-workflows + name: OpenAPI -on: - pull_request: +on: pull_request permissions: contents: read -concurrency: - group: openapi-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - jobs: openapi: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - name: Get php version - id: php_versions - uses: icewind1991/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 - - - name: Set up php - uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0 - with: - php-version: ${{ steps.php_versions.outputs.php-available }} - extensions: xml - coverage: none - ini-file: development - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check Typescript OpenAPI types - id: check_typescript_openapi - uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 - with: - files: src/types/openapi/openapi*.ts - - - name: Read package.json node and npm engines version - if: steps.check_typescript_openapi.outputs.files_exists == 'true' - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 - id: node_versions - continue-on-error: true - with: - fallbackNode: '^24' - fallbackNpm: '^11.3' - - - name: Set up node ${{ steps.node_versions.outputs.nodeVersion }} - if: ${{ steps.node_versions.outputs.nodeVersion }} - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version: ${{ steps.node_versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.node_versions.outputs.npmVersion }} - if: ${{ steps.node_versions.outputs.nodeVersion }} - run: npm i -g 'npm@${{ steps.node_versions.outputs.npmVersion }}' - - - name: Install node dependencies - if: ${{ steps.node_versions.outputs.nodeVersion }} - env: - CYPRESS_INSTALL_BINARY: 0 - PUPPETEER_SKIP_DOWNLOAD: true - run: npm ci - - - name: Install dependencies - run: composer i - - - name: Regenerate OpenAPI - run: composer run openapi - - - name: Regenerate TypeScript OpenAPI types - if: steps.check_typescript_openapi.outputs.files_exists == 'true' - run: npm run typescript:generate - - - name: Check openapi*.json and typescript changes - run: | - bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please run \"composer run openapi\" and commit the openapi*.json files and, if applicable, src/types/openapi/openapi*.ts. See the diff below.' && exit 1)" - - - name: Show changes on failure - if: failure() - run: | - git status - git --no-pager diff - exit 1 + uses: LibreCodeCoop/github-workflows/.github/workflows/openapi.yml@bfd8f06a82ff2fdd95becc1f752363c640f314ca diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 35ff0a81..b7fa5100 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -1,58 +1,16 @@ -# SPDX-FileCopyrightText: 2026 LibreCode Coop and LibreCode contributors -# +# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors # SPDX-License-Identifier: AGPL-3.0-or-later +# This workflow is published through the LibreCode organization catalog. +# Implementation: LibreCodeCoop/github-workflows + name: Static analysis -on: - pull_request: +on: pull_request permissions: contents: read -concurrency: - group: psalm-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - jobs: - static-analysis: - runs-on: ubuntu-latest - name: static-psalm-analysis - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - name: Get php version - id: versions - uses: icewind1991/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 - - - 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@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0 - 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 - ini-values: disable_functions= - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Install dependencies - run: | - 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 Psalm - run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github + psalm: + uses: LibreCodeCoop/github-workflows/.github/workflows/psalm.yml@bedd8421ad6c95914f10f0dc631333223d17c515