diff --git a/patches/nextcloud/block-unconventional-commits.yml.patch b/patches/nextcloud/block-unconventional-commits.yml.patch new file mode 100644 index 0000000..92c5b89 --- /dev/null +++ b/patches/nextcloud/block-unconventional-commits.yml.patch @@ -0,0 +1,69 @@ +--- upstream/vendor/nextcloud/block-unconventional-commits.yml ++++ .github/workflows/block-unconventional-commits.yml +@@ -1,36 +1,30 @@ +-# This workflow is provided via the organization template repository +-# +-# https://github.com/nextcloud/.github +-# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +-# +-# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors +-# SPDX-License-Identifier: MIT +- +-name: Block unconventional commits +- +-on: +- pull_request: +- types: [opened, ready_for_review, reopened, synchronize] +- +-permissions: +- contents: read +- +-concurrency: +- group: block-unconventional-commits-${{ github.head_ref || github.run_id }} +- cancel-in-progress: true +- +-jobs: +- block-unconventional-commits: +- name: Block unconventional commits +- +- runs-on: ubuntu-latest-low +- +- steps: +- - name: Checkout +- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 +- with: +- persist-credentials: false +- +- - uses: webiny/action-conventional-commits@7f91b1595ca1951cdb671ddc9f07a49081ec5b69 # v1.4.2 +- with: +- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ++# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors ++# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors ++# SPDX-License-Identifier: MIT ++ ++name: Block unconventional commits ++ ++on: ++ workflow_call: ++ ++permissions: ++ contents: read ++ ++concurrency: ++ group: block-unconventional-commits-${{ github.head_ref || github.run_id }} ++ cancel-in-progress: true ++ ++jobs: ++ block-unconventional-commits: ++ name: Block unconventional commits ++ runs-on: ubuntu-latest ++ steps: ++ - name: Checkout ++ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 ++ with: ++ persist-credentials: false ++ ++ - name: Validate conventional commits ++ uses: webiny/action-conventional-commits@7f91b1595ca1951cdb671ddc9f07a49081ec5b69 # v1.4.2 ++ with: ++ GITHUB_TOKEN: ${{ github.token }} diff --git a/patches/nextcloud/lint-eslint.yml.patch b/patches/nextcloud/lint-eslint.yml.patch new file mode 100644 index 0000000..0020a90 --- /dev/null +++ b/patches/nextcloud/lint-eslint.yml.patch @@ -0,0 +1,200 @@ +--- upstream/vendor/nextcloud/lint-eslint.yml ++++ .github/workflows/lint-eslint.yml +@@ -1,100 +1,97 @@ +-# This workflow is provided via the organization template repository +-# +-# 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 eslint +- +-on: pull_request +- +-permissions: +- contents: read +- +-concurrency: +- group: lint-eslint-${{ github.head_ref || github.run_id }} +- cancel-in-progress: true +- +-jobs: +- changes: +- runs-on: ubuntu-latest-low +- permissions: +- contents: read +- pull-requests: read +- +- outputs: +- src: ${{ steps.changes.outputs.src}} +- +- steps: +- - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 +- id: changes +- continue-on-error: true +- with: +- filters: | +- src: +- - '.github/workflows/**' +- - 'src/**' +- - 'appinfo/info.xml' +- - 'package.json' +- - 'package-lock.json' +- - 'tsconfig.json' +- - '.eslintrc.*' +- - '.eslintignore' +- - '**.js' +- - '**.ts' +- - '**.vue' +- +- lint: +- runs-on: ubuntu-latest +- +- needs: changes +- if: needs.changes.outputs.src != 'false' +- +- name: NPM lint +- +- steps: +- - name: Checkout +- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 +- with: +- persist-credentials: false +- +- - name: Read package.json node and npm engines version +- uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 +- id: versions +- with: +- fallbackNode: '^24' +- fallbackNpm: '^11.3' +- +- - name: Set up node ${{ steps.versions.outputs.nodeVersion }} +- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 +- with: +- node-version: ${{ steps.versions.outputs.nodeVersion }} +- +- - name: Set up npm ${{ steps.versions.outputs.npmVersion }} +- run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' +- +- - name: Install dependencies +- env: +- CYPRESS_INSTALL_BINARY: 0 +- PUPPETEER_SKIP_DOWNLOAD: true +- run: npm ci +- +- - name: Lint +- run: npm run lint +- +- summary: +- permissions: +- contents: none +- runs-on: ubuntu-latest-low +- needs: [changes, lint] +- +- if: always() +- +- # This is the summary, we just avoid to rename it so that branch protection rules still match +- name: eslint +- +- steps: +- - name: Summary status +- run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi ++# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors ++# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors ++# SPDX-License-Identifier: MIT ++ ++name: Lint eslint ++ ++on: ++ workflow_call: ++ ++permissions: ++ contents: read ++ ++concurrency: ++ group: lint-eslint-${{ github.head_ref || github.run_id }} ++ cancel-in-progress: true ++ ++jobs: ++ changes: ++ runs-on: ubuntu-latest ++ permissions: ++ contents: read ++ pull-requests: read ++ outputs: ++ src: ${{ steps.changes.outputs.src }} ++ steps: ++ - name: Detect JavaScript changes ++ id: changes ++ uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 ++ continue-on-error: true ++ with: ++ filters: | ++ src: ++ - '.github/workflows/**' ++ - 'src/**' ++ - 'appinfo/info.xml' ++ - 'package.json' ++ - 'package-lock.json' ++ - 'tsconfig.json' ++ - '.eslintrc.*' ++ - '.eslintignore' ++ - '**.js' ++ - '**.ts' ++ - '**.vue' ++ ++ lint: ++ runs-on: ubuntu-latest ++ needs: changes ++ if: needs.changes.outputs.src != 'false' ++ name: NPM lint ++ steps: ++ - name: Checkout ++ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 ++ with: ++ persist-credentials: false ++ ++ - name: Read package.json engines ++ id: versions ++ uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 ++ with: ++ fallbackNode: '^24' ++ fallbackNpm: '^11.3' ++ ++ - name: Set up node ${{ steps.versions.outputs.nodeVersion }} ++ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 ++ with: ++ node-version: ${{ steps.versions.outputs.nodeVersion }} ++ ++ - name: Show npm version ++ run: npm --version ++ ++ - name: Install dependencies ++ env: ++ CYPRESS_INSTALL_BINARY: 0 ++ PUPPETEER_SKIP_DOWNLOAD: true ++ run: npm ci ++ ++ - name: Lint ++ run: npm run lint ++ ++ summary: ++ permissions: ++ contents: none ++ runs-on: ubuntu-latest ++ needs: ++ - changes ++ - lint ++ if: always() ++ name: eslint ++ steps: ++ - name: Summary status ++ env: ++ CHANGED: ${{ needs.changes.outputs.src }} ++ LINT_RESULT: ${{ needs.lint.result }} ++ run: | ++ if [ "$CHANGED" != "false" ] && [ "$LINT_RESULT" != "success" ]; then ++ exit 1 ++ fi diff --git a/patches/nextcloud/lint-info-xml.yml.patch b/patches/nextcloud/lint-info-xml.yml.patch new file mode 100644 index 0000000..a458c3b --- /dev/null +++ b/patches/nextcloud/lint-info-xml.yml.patch @@ -0,0 +1,77 @@ +--- upstream/vendor/nextcloud/lint-info-xml.yml ++++ .github/workflows/lint-info-xml.yml +@@ -1,40 +1,34 @@ +-# This workflow is provided via the organization template repository +-# +-# 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 info.xml +- +-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-low +- +- name: info.xml lint +- steps: +- - name: Checkout +- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 +- with: +- persist-credentials: false +- sparse-checkout: | +- appinfo/ +- +- - 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 ++# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors ++# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors ++# SPDX-License-Identifier: MIT ++ ++name: Lint info.xml ++ ++on: ++ workflow_call: ++ ++permissions: ++ contents: read ++ ++jobs: ++ xml-linters: ++ name: info.xml lint ++ runs-on: ubuntu-latest ++ steps: ++ - name: Checkout ++ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 ++ with: ++ persist-credentials: false ++ sparse-checkout: | ++ appinfo/ ++ ++ - name: Download schema ++ run: >- ++ wget ++ https://raw.githubusercontent.com/nextcloud/appstore/c8fe8dcb388d2ed7b566e982fd64aa38463ba80a/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 diff --git a/patches/nextcloud/lint-php-cs.yml.patch b/patches/nextcloud/lint-php-cs.yml.patch new file mode 100644 index 0000000..b9ee5b2 --- /dev/null +++ b/patches/nextcloud/lint-php-cs.yml.patch @@ -0,0 +1,105 @@ +--- upstream/vendor/nextcloud/lint-php-cs.yml ++++ .github/workflows/lint-php-cs.yml +@@ -1,54 +1,48 @@ +-# This workflow is provided via the organization template repository +-# +-# 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-cs +- +-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: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 +- +- - name: Set up php${{ steps.versions.outputs.php-min }} +- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 +- 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: Remove nextcloud/ocp +- run: | +- composer remove nextcloud/ocp --dev --no-scripts +- +- - name: Install composer dependencies +- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 +- +- - name: Lint +- run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) ++# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors ++# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors ++# SPDX-License-Identifier: MIT ++ ++name: Lint php-cs ++ ++on: ++ workflow_call: ++ ++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: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 ++ ++ - name: Set up php${{ steps.versions.outputs.php-min }} ++ uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 ++ 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: ${{ github.token }} ++ ++ - name: Remove nextcloud/ocp ++ run: composer remove nextcloud/ocp --dev --no-scripts ++ ++ - name: Install composer dependencies ++ uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 ++ ++ - name: Lint ++ run: composer run cs:check diff --git a/patches/nextcloud/lint-php.yml.patch b/patches/nextcloud/lint-php.yml.patch new file mode 100644 index 0000000..f6e66df --- /dev/null +++ b/patches/nextcloud/lint-php.yml.patch @@ -0,0 +1,156 @@ +--- upstream/vendor/nextcloud/lint-php.yml ++++ .github/workflows/lint-php.yml +@@ -1,76 +1,77 @@ +-# This workflow is provided via the organization template repository +-# +-# 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 +- +-permissions: +- contents: read +- +-concurrency: +- group: lint-php-${{ github.head_ref || github.run_id }} +- cancel-in-progress: true +- +-jobs: +- matrix: +- runs-on: ubuntu-latest-low +- 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: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 +- +- php-lint: +- runs-on: ubuntu-latest-low +- needs: matrix +- strategy: +- matrix: +- php-versions: ['${{ needs.matrix.outputs.php-min }}', '${{ needs.matrix.outputs.php-max }}'] +- +- name: php-lint +- +- 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@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 +- 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: composer run lint +- +- summary: +- permissions: +- contents: none +- runs-on: ubuntu-latest-low +- 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 ++# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors ++# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors ++# SPDX-License-Identifier: MIT ++ ++name: Lint php ++ ++on: ++ workflow_call: ++ ++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: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 ++ ++ php-lint: ++ runs-on: ubuntu-latest ++ needs: matrix ++ strategy: ++ matrix: ++ php-versions: ++ - '${{ needs.matrix.outputs.php-min }}' ++ - '${{ needs.matrix.outputs.php-max }}' ++ ++ name: php-lint ++ ++ 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@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 ++ 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: ${{ github.token }} ++ ++ - 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 ++ env: ++ RESULT: ${{ needs.php-lint.result }} ++ run: | ++ if [ "$RESULT" != "success" ] && [ "$RESULT" != "skipped" ]; then ++ exit 1 ++ fi diff --git a/patches/nextcloud/lint-stylelint.yml.patch b/patches/nextcloud/lint-stylelint.yml.patch new file mode 100644 index 0000000..f5f36d1 --- /dev/null +++ b/patches/nextcloud/lint-stylelint.yml.patch @@ -0,0 +1,105 @@ +--- upstream/vendor/nextcloud/lint-stylelint.yml ++++ .github/workflows/lint-stylelint.yml +@@ -1,53 +1,49 @@ +-# This workflow is provided via the organization template repository +-# +-# 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 stylelint +- +-on: pull_request +- +-permissions: +- contents: read +- +-concurrency: +- group: lint-stylelint-${{ github.head_ref || github.run_id }} +- cancel-in-progress: true +- +-jobs: +- lint: +- runs-on: ubuntu-latest +- +- name: stylelint +- +- steps: +- - name: Checkout +- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 +- with: +- persist-credentials: false +- +- - name: Read package.json node and npm engines version +- uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 +- id: versions +- with: +- fallbackNode: '^24' +- fallbackNpm: '^11.3' +- +- - name: Set up node ${{ steps.versions.outputs.nodeVersion }} +- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 +- with: +- node-version: ${{ steps.versions.outputs.nodeVersion }} +- +- - name: Set up npm ${{ steps.versions.outputs.npmVersion }} +- run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' +- +- - name: Install dependencies +- env: +- CYPRESS_INSTALL_BINARY: 0 +- run: npm ci +- +- - name: Lint +- run: npm run stylelint ++# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors ++# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors ++# SPDX-License-Identifier: MIT ++ ++name: Lint stylelint ++ ++on: ++ workflow_call: ++ ++permissions: ++ contents: read ++ ++concurrency: ++ group: lint-stylelint-${{ github.head_ref || github.run_id }} ++ cancel-in-progress: true ++ ++jobs: ++ lint: ++ runs-on: ubuntu-latest ++ name: stylelint ++ steps: ++ - name: Checkout ++ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 ++ with: ++ persist-credentials: false ++ ++ - name: Read package.json engines ++ id: versions ++ uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 ++ with: ++ fallbackNode: '^24' ++ fallbackNpm: '^11.3' ++ ++ - name: Set up node ${{ steps.versions.outputs.nodeVersion }} ++ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 ++ with: ++ node-version: ${{ steps.versions.outputs.nodeVersion }} ++ ++ - name: Show npm version ++ run: npm --version ++ ++ - name: Install dependencies ++ env: ++ CYPRESS_INSTALL_BINARY: 0 ++ PUPPETEER_SKIP_DOWNLOAD: true ++ run: npm ci ++ ++ - name: Lint ++ run: npm run stylelint diff --git a/patches/nextcloud/npm-build.yml.patch b/patches/nextcloud/npm-build.yml.patch new file mode 100644 index 0000000..c99cc5a --- /dev/null +++ b/patches/nextcloud/npm-build.yml.patch @@ -0,0 +1,229 @@ +--- upstream/vendor/nextcloud/npm-build.yml ++++ .github/workflows/npm-build.yml +@@ -1,113 +1,113 @@ +-# This workflow is provided via the organization template repository +-# +-# 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: Build Javascript +- +-on: pull_request +- +-permissions: +- contents: read +- +-concurrency: +- group: node-${{ github.head_ref || github.run_id }} +- cancel-in-progress: true +- +-jobs: +- changes: +- runs-on: ubuntu-latest-low +- permissions: +- contents: read +- pull-requests: read +- +- outputs: +- src: ${{ steps.changes.outputs.src}} +- +- steps: +- - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 +- id: changes +- continue-on-error: true +- with: +- filters: | +- src: +- - '.github/workflows/**' +- - 'src/**' +- - 'appinfo/info.xml' +- - 'package.json' +- - 'package-lock.json' +- - 'tsconfig.json' +- - '**.js' +- - '**.ts' +- - '**.vue' +- +- build: +- runs-on: ubuntu-latest +- +- needs: changes +- if: needs.changes.outputs.src != 'false' +- +- name: NPM build +- steps: +- - name: Checkout +- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 +- with: +- persist-credentials: false +- +- - name: Read package.json node and npm engines version +- uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 +- id: versions +- with: +- fallbackNode: '^24' +- fallbackNpm: '^11.3' +- +- - name: Set up node ${{ steps.versions.outputs.nodeVersion }} +- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 +- with: +- node-version: ${{ steps.versions.outputs.nodeVersion }} +- +- - name: Set up npm ${{ steps.versions.outputs.npmVersion }} +- run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' +- +- - name: Validate package-lock.json # See https://github.com/npm/cli/issues/4460 +- run: | +- npm i -g npm-package-lock-add-resolved@1.1.4 +- npm-package-lock-add-resolved +- git --no-pager diff --exit-code +- +- - name: Install dependencies & build +- env: +- CYPRESS_INSTALL_BINARY: 0 +- PUPPETEER_SKIP_DOWNLOAD: true +- run: | +- npm ci +- npm run build --if-present +- +- - name: Check build changes +- run: | +- bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)" +- +- - name: Show changes on failure +- if: failure() +- run: | +- git status +- git --no-pager diff +- exit 1 # make it red to grab attention +- +- summary: +- permissions: +- contents: none +- runs-on: ubuntu-latest-low +- needs: [changes, build] +- +- if: always() +- +- # This is the summary, we just avoid to rename it so that branch protection rules still match +- name: node +- +- steps: +- - name: Summary status +- run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi ++# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors ++# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors ++# SPDX-License-Identifier: MIT ++ ++name: Build Javascript ++ ++on: ++ workflow_call: ++ ++permissions: ++ contents: read ++ ++concurrency: ++ group: node-${{ github.head_ref || github.run_id }} ++ cancel-in-progress: true ++ ++jobs: ++ changes: ++ runs-on: ubuntu-latest ++ permissions: ++ contents: read ++ pull-requests: read ++ outputs: ++ src: ${{ steps.changes.outputs.src }} ++ steps: ++ - name: Detect frontend changes ++ id: changes ++ uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 ++ continue-on-error: true ++ with: ++ filters: | ++ src: ++ - '.github/workflows/**' ++ - 'src/**' ++ - 'appinfo/info.xml' ++ - 'package.json' ++ - 'package-lock.json' ++ - 'tsconfig.json' ++ - '**.js' ++ - '**.ts' ++ - '**.vue' ++ ++ build: ++ runs-on: ubuntu-latest ++ needs: changes ++ if: needs.changes.outputs.src != 'false' ++ name: NPM build ++ steps: ++ - name: Checkout ++ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 ++ with: ++ persist-credentials: false ++ ++ - name: Read package.json node and npm engines version ++ id: versions ++ uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 ++ with: ++ fallbackNode: '^24' ++ fallbackNpm: '^11.3' ++ ++ - name: Set up node ${{ steps.versions.outputs.nodeVersion }} ++ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 ++ with: ++ node-version: ${{ steps.versions.outputs.nodeVersion }} ++ ++ - name: Show npm version ++ run: npm --version ++ ++ - name: Validate package-lock.json ++ run: | ++ npm exec --yes --package=npm-package-lock-add-resolved@1.1.4 -- npm-package-lock-add-resolved ++ git --no-pager diff --exit-code ++ ++ - name: Install dependencies and build ++ env: ++ CYPRESS_INSTALL_BINARY: 0 ++ PUPPETEER_SKIP_DOWNLOAD: true ++ run: | ++ npm ci ++ npm run build --if-present ++ ++ - name: Check build changes ++ run: | ++ if [ -n "$(git status --porcelain)" ]; then ++ echo 'Please recompile and commit the assets. See the "Show changes on failure" step for details.' ++ exit 1 ++ fi ++ ++ - name: Show changes on failure ++ if: failure() ++ run: | ++ git status ++ git --no-pager diff ++ exit 1 ++ ++ summary: ++ permissions: ++ contents: none ++ runs-on: ubuntu-latest ++ needs: ++ - changes ++ - build ++ if: always() ++ name: node ++ steps: ++ - name: Summary status ++ env: ++ CHANGED: ${{ needs.changes.outputs.src }} ++ BUILD_RESULT: ${{ needs.build.result }} ++ run: | ++ if [ "$CHANGED" != "false" ] && [ "$BUILD_RESULT" != "success" ]; then ++ exit 1 ++ fi diff --git a/patches/nextcloud/openapi.yml.patch b/patches/nextcloud/openapi.yml.patch new file mode 100644 index 0000000..69ab9af --- /dev/null +++ b/patches/nextcloud/openapi.yml.patch @@ -0,0 +1,190 @@ +--- upstream/vendor/nextcloud/openapi.yml ++++ .github/workflows/openapi.yml +@@ -1,96 +1,91 @@ +-# This workflow is provided via the organization template repository +-# +-# https://github.com/nextcloud/.github +-# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +-# +-# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors +-# SPDX-FileCopyrightText: 2024 Arthur Schiwon +-# SPDX-License-Identifier: MIT +- +-name: OpenAPI +- +-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: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 +- +- - name: Set up php +- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 +- 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 if no package.json +- 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@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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 dependencies +- if: ${{ steps.node_versions.outputs.nodeVersion }} +- env: +- CYPRESS_INSTALL_BINARY: 0 +- PUPPETEER_SKIP_DOWNLOAD: true +- run: | +- npm ci +- +- - name: Install composer dependencies +- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 +- +- - name: Regenerate OpenAPI +- run: composer run openapi +- +- - 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 section \"Show changes on failure\" for details' && exit 1)" +- +- - name: Show changes on failure +- if: failure() +- run: | +- git status +- git --no-pager diff +- exit 1 # make it red to grab attention ++# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors ++# SPDX-FileCopyrightText: 2024 Arthur Schiwon ++# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors ++# SPDX-License-Identifier: MIT ++ ++name: OpenAPI ++ ++on: ++ workflow_call: ++ ++permissions: ++ contents: read ++ ++concurrency: ++ group: openapi-${{ github.head_ref || github.run_id }} ++ cancel-in-progress: true ++ ++jobs: ++ openapi: ++ runs-on: ubuntu-latest ++ steps: ++ - name: Checkout ++ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 ++ with: ++ persist-credentials: false ++ ++ - name: Get php version ++ id: php_versions ++ uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 ++ ++ - name: Set up php ++ uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 ++ with: ++ php-version: ${{ steps.php_versions.outputs.php-available }} ++ extensions: xml ++ coverage: none ++ ini-file: development ++ env: ++ GITHUB_TOKEN: ${{ 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 engines ++ if: steps.check_typescript_openapi.outputs.files_exists == 'true' ++ id: node_versions ++ continue-on-error: true ++ uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 ++ 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@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 ++ with: ++ node-version: ${{ steps.node_versions.outputs.nodeVersion }} ++ ++ - name: Show npm version ++ if: steps.node_versions.outputs.nodeVersion ++ run: npm --version ++ ++ - name: Install npm dependencies ++ if: steps.node_versions.outputs.nodeVersion ++ env: ++ CYPRESS_INSTALL_BINARY: 0 ++ PUPPETEER_SKIP_DOWNLOAD: true ++ run: npm ci ++ ++ - name: Install composer dependencies ++ uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 ++ ++ - name: Regenerate OpenAPI ++ run: composer run openapi ++ ++ - name: Check generated OpenAPI files ++ run: | ++ if [ -n "$(git status --porcelain)" ]; then ++ echo 'Please run "composer run openapi" and commit the generated OpenAPI JSON and TypeScript files.' ++ exit 1 ++ fi ++ ++ - name: Show changes on failure ++ if: failure() ++ run: | ++ git status ++ git --no-pager diff ++ exit 1 diff --git a/patches/nextcloud/psalm.yml.patch b/patches/nextcloud/psalm.yml.patch new file mode 100644 index 0000000..1b1dac9 --- /dev/null +++ b/patches/nextcloud/psalm.yml.patch @@ -0,0 +1,127 @@ +--- upstream/vendor/nextcloud/psalm.yml ++++ .github/workflows/psalm.yml +@@ -1,61 +1,63 @@ +-# This workflow is provided via the organization template repository +-# +-# 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 +- +-concurrency: +- group: psalm-${{ github.head_ref || github.run_id }} +- cancel-in-progress: true +- +-permissions: +- contents: read +- +-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: nextcloud-libraries/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@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 +- 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: Remove nextcloud/ocp +- run: | +- composer remove nextcloud/ocp --dev --no-scripts +- +- - name: Install composer dependencies +- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 +- +- - name: Install nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} +- 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 ++# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors ++# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors ++# SPDX-License-Identifier: MIT ++ ++name: Static analysis ++ ++on: ++ workflow_call: ++ ++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: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 ++ ++ - name: Check minimum PHP version in psalm.xml ++ env: ++ PHP_MIN: ${{ steps.versions.outputs.php-min }} ++ run: grep "phpVersion=\"$PHP_MIN" psalm.xml ++ ++ - name: Set up php${{ steps.versions.outputs.php-available }} ++ uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 ++ 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: ${{ github.token }} ++ ++ - name: Remove nextcloud/ocp ++ run: composer remove nextcloud/ocp --dev --no-scripts ++ ++ - name: Install composer dependencies ++ uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 ++ ++ - name: Install supported nextcloud/ocp ++ env: ++ OCP_BRANCH: ${{ steps.versions.outputs.branches-max }} ++ run: >- ++ composer require --dev ++ "nextcloud/ocp:dev-$OCP_BRANCH" ++ --ignore-platform-reqs ++ --with-dependencies ++ ++ - name: Run Psalm ++ run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github diff --git a/upstream/sources.json b/upstream/sources.json index a3463d0..592d7d8 100644 --- a/upstream/sources.json +++ b/upstream/sources.json @@ -9,6 +9,87 @@ "sha256": "4710d78c576abd1c875d799770f67262988119404d58d379656f5932872fcba8", "destination": "upstream/vendor/nextcloud/appstore-build-publish.yml" }, + { + "name": "nextcloud-block-unconventional-commits", + "repository": "nextcloud/.github", + "ref": "master", + "path": "workflow-templates/block-unconventional-commits.yml", + "url": "https://raw.githubusercontent.com/nextcloud/.github/cf6248d5ef28a328cde764daf80bc5fae4705ade/workflow-templates/block-unconventional-commits.yml", + "sha256": "a123a3045de59f81b67e4554b9e463c1dbcd0ec7db745e53ea3cd7790f5b2e39", + "destination": "upstream/vendor/nextcloud/block-unconventional-commits.yml" + }, + { + "name": "nextcloud-lint-eslint", + "repository": "nextcloud/.github", + "ref": "master", + "path": "workflow-templates/lint-eslint.yml", + "url": "https://raw.githubusercontent.com/nextcloud/.github/cf6248d5ef28a328cde764daf80bc5fae4705ade/workflow-templates/lint-eslint.yml", + "sha256": "f26cdca597f39732ebb42adba611633ba2c1249d285366bb0d3281f85df5f8dd", + "destination": "upstream/vendor/nextcloud/lint-eslint.yml" + }, + { + "name": "nextcloud-lint-info-xml", + "repository": "nextcloud/.github", + "ref": "master", + "path": "workflow-templates/lint-info-xml.yml", + "url": "https://raw.githubusercontent.com/nextcloud/.github/cf6248d5ef28a328cde764daf80bc5fae4705ade/workflow-templates/lint-info-xml.yml", + "sha256": "cdfd953e3b0b04dfe0ac4c35169a4f6c58a2b62028c918d3d0d1c19e0a3237aa", + "destination": "upstream/vendor/nextcloud/lint-info-xml.yml" + }, + { + "name": "nextcloud-lint-php", + "repository": "nextcloud/.github", + "ref": "master", + "path": "workflow-templates/lint-php.yml", + "url": "https://raw.githubusercontent.com/nextcloud/.github/cf6248d5ef28a328cde764daf80bc5fae4705ade/workflow-templates/lint-php.yml", + "sha256": "cdf80971a01d51a42cbcf4e0326e3830fa3613b0072b322d5277ba310873dd4b", + "destination": "upstream/vendor/nextcloud/lint-php.yml" + }, + { + "name": "nextcloud-lint-php-cs", + "repository": "nextcloud/.github", + "ref": "master", + "path": "workflow-templates/lint-php-cs.yml", + "url": "https://raw.githubusercontent.com/nextcloud/.github/cf6248d5ef28a328cde764daf80bc5fae4705ade/workflow-templates/lint-php-cs.yml", + "sha256": "e6047b215571aa2746bd3d2786a14b3e0122fc34e70755a29ff573bb21e1672c", + "destination": "upstream/vendor/nextcloud/lint-php-cs.yml" + }, + { + "name": "nextcloud-lint-stylelint", + "repository": "nextcloud/.github", + "ref": "master", + "path": "workflow-templates/lint-stylelint.yml", + "url": "https://raw.githubusercontent.com/nextcloud/.github/cf6248d5ef28a328cde764daf80bc5fae4705ade/workflow-templates/lint-stylelint.yml", + "sha256": "e66e5c0b4ff2cf6741a1891849ea3de8662c77c6d198131e0cf54ab2a82cccf7", + "destination": "upstream/vendor/nextcloud/lint-stylelint.yml" + }, + { + "name": "nextcloud-npm-build", + "repository": "nextcloud/.github", + "ref": "master", + "path": "workflow-templates/npm-build.yml", + "url": "https://raw.githubusercontent.com/nextcloud/.github/cf6248d5ef28a328cde764daf80bc5fae4705ade/workflow-templates/npm-build.yml", + "sha256": "0004666c0ac21d5c10aee4b5912cac74de16f7d2e4e8d0307429aba4e4d1b838", + "destination": "upstream/vendor/nextcloud/npm-build.yml" + }, + { + "name": "nextcloud-openapi", + "repository": "nextcloud/.github", + "ref": "master", + "path": "workflow-templates/openapi.yml", + "url": "https://raw.githubusercontent.com/nextcloud/.github/cf6248d5ef28a328cde764daf80bc5fae4705ade/workflow-templates/openapi.yml", + "sha256": "9e83f1409b455532b434f7a753b04e1e81a5e6e2a7e1291620ef443dee21bf5c", + "destination": "upstream/vendor/nextcloud/openapi.yml" + }, + { + "name": "nextcloud-psalm", + "repository": "nextcloud/.github", + "ref": "master", + "path": "workflow-templates/psalm.yml", + "url": "https://raw.githubusercontent.com/nextcloud/.github/cf6248d5ef28a328cde764daf80bc5fae4705ade/workflow-templates/psalm.yml", + "sha256": "02d1db3a1549f5fa933b7157fc1a18d4b4593b35745a1f18be3f49e6e0499bd8", + "destination": "upstream/vendor/nextcloud/psalm.yml" + }, { "name": "nextcloud-reuse", "repository": "nextcloud/.github", diff --git a/upstream/templates.json b/upstream/templates.json index 9e391fc..2deccf4 100644 --- a/upstream/templates.json +++ b/upstream/templates.json @@ -8,6 +8,78 @@ ], "destination": "workflow-templates/appstore-build-publish.yml" }, + { + "name": "nextcloud-block-unconventional-commits", + "source": "upstream/vendor/nextcloud/block-unconventional-commits.yml", + "patches": [ + "patches/nextcloud/block-unconventional-commits.yml.patch" + ], + "destination": ".github/workflows/block-unconventional-commits.yml" + }, + { + "name": "nextcloud-lint-eslint", + "source": "upstream/vendor/nextcloud/lint-eslint.yml", + "patches": [ + "patches/nextcloud/lint-eslint.yml.patch" + ], + "destination": ".github/workflows/lint-eslint.yml" + }, + { + "name": "nextcloud-lint-info-xml", + "source": "upstream/vendor/nextcloud/lint-info-xml.yml", + "patches": [ + "patches/nextcloud/lint-info-xml.yml.patch" + ], + "destination": ".github/workflows/lint-info-xml.yml" + }, + { + "name": "nextcloud-lint-php", + "source": "upstream/vendor/nextcloud/lint-php.yml", + "patches": [ + "patches/nextcloud/lint-php.yml.patch" + ], + "destination": ".github/workflows/lint-php.yml" + }, + { + "name": "nextcloud-lint-php-cs", + "source": "upstream/vendor/nextcloud/lint-php-cs.yml", + "patches": [ + "patches/nextcloud/lint-php-cs.yml.patch" + ], + "destination": ".github/workflows/lint-php-cs.yml" + }, + { + "name": "nextcloud-lint-stylelint", + "source": "upstream/vendor/nextcloud/lint-stylelint.yml", + "patches": [ + "patches/nextcloud/lint-stylelint.yml.patch" + ], + "destination": ".github/workflows/lint-stylelint.yml" + }, + { + "name": "nextcloud-npm-build", + "source": "upstream/vendor/nextcloud/npm-build.yml", + "patches": [ + "patches/nextcloud/npm-build.yml.patch" + ], + "destination": ".github/workflows/npm-build.yml" + }, + { + "name": "nextcloud-openapi", + "source": "upstream/vendor/nextcloud/openapi.yml", + "patches": [ + "patches/nextcloud/openapi.yml.patch" + ], + "destination": ".github/workflows/openapi.yml" + }, + { + "name": "nextcloud-psalm", + "source": "upstream/vendor/nextcloud/psalm.yml", + "patches": [ + "patches/nextcloud/psalm.yml.patch" + ], + "destination": ".github/workflows/psalm.yml" + }, { "name": "nextcloud-reuse", "source": "upstream/vendor/nextcloud/reuse.yml", diff --git a/upstream/vendor/nextcloud/block-unconventional-commits.yml b/upstream/vendor/nextcloud/block-unconventional-commits.yml new file mode 100644 index 0000000..4972f8b --- /dev/null +++ b/upstream/vendor/nextcloud/block-unconventional-commits.yml @@ -0,0 +1,36 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT + +name: Block unconventional commits + +on: + pull_request: + types: [opened, ready_for_review, reopened, synchronize] + +permissions: + contents: read + +concurrency: + group: block-unconventional-commits-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + block-unconventional-commits: + name: Block unconventional commits + + runs-on: ubuntu-latest-low + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - uses: webiny/action-conventional-commits@7f91b1595ca1951cdb671ddc9f07a49081ec5b69 # v1.4.2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/upstream/vendor/nextcloud/lint-eslint.yml b/upstream/vendor/nextcloud/lint-eslint.yml new file mode 100644 index 0000000..5ad2d20 --- /dev/null +++ b/upstream/vendor/nextcloud/lint-eslint.yml @@ -0,0 +1,100 @@ +# This workflow is provided via the organization template repository +# +# 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 eslint + +on: pull_request + +permissions: + contents: read + +concurrency: + group: lint-eslint-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + changes: + runs-on: ubuntu-latest-low + permissions: + contents: read + pull-requests: read + + outputs: + src: ${{ steps.changes.outputs.src}} + + steps: + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + id: changes + continue-on-error: true + with: + filters: | + src: + - '.github/workflows/**' + - 'src/**' + - 'appinfo/info.xml' + - 'package.json' + - 'package-lock.json' + - 'tsconfig.json' + - '.eslintrc.*' + - '.eslintignore' + - '**.js' + - '**.ts' + - '**.vue' + + lint: + runs-on: ubuntu-latest + + needs: changes + if: needs.changes.outputs.src != 'false' + + name: NPM lint + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + id: versions + with: + fallbackNode: '^24' + fallbackNpm: '^11.3' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + + - name: Install dependencies + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: npm ci + + - name: Lint + run: npm run lint + + summary: + permissions: + contents: none + runs-on: ubuntu-latest-low + needs: [changes, lint] + + if: always() + + # This is the summary, we just avoid to rename it so that branch protection rules still match + name: eslint + + steps: + - name: Summary status + run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi diff --git a/upstream/vendor/nextcloud/lint-info-xml.yml b/upstream/vendor/nextcloud/lint-info-xml.yml new file mode 100644 index 0000000..8e6968c --- /dev/null +++ b/upstream/vendor/nextcloud/lint-info-xml.yml @@ -0,0 +1,40 @@ +# This workflow is provided via the organization template repository +# +# 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 info.xml + +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-low + + name: info.xml lint + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + sparse-checkout: | + appinfo/ + + - 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 diff --git a/upstream/vendor/nextcloud/lint-php-cs.yml b/upstream/vendor/nextcloud/lint-php-cs.yml new file mode 100644 index 0000000..06d0842 --- /dev/null +++ b/upstream/vendor/nextcloud/lint-php-cs.yml @@ -0,0 +1,54 @@ +# This workflow is provided via the organization template repository +# +# 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-cs + +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: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 + + - name: Set up php${{ steps.versions.outputs.php-min }} + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + 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: Remove nextcloud/ocp + run: | + composer remove nextcloud/ocp --dev --no-scripts + + - name: Install composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + + - name: Lint + run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) diff --git a/upstream/vendor/nextcloud/lint-php.yml b/upstream/vendor/nextcloud/lint-php.yml new file mode 100644 index 0000000..e4c6e9b --- /dev/null +++ b/upstream/vendor/nextcloud/lint-php.yml @@ -0,0 +1,76 @@ +# This workflow is provided via the organization template repository +# +# 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 + +permissions: + contents: read + +concurrency: + group: lint-php-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + matrix: + runs-on: ubuntu-latest-low + 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: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 + + php-lint: + runs-on: ubuntu-latest-low + needs: matrix + strategy: + matrix: + php-versions: ['${{ needs.matrix.outputs.php-min }}', '${{ needs.matrix.outputs.php-max }}'] + + name: php-lint + + 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@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + 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: composer run lint + + summary: + permissions: + contents: none + runs-on: ubuntu-latest-low + 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 diff --git a/upstream/vendor/nextcloud/lint-stylelint.yml b/upstream/vendor/nextcloud/lint-stylelint.yml new file mode 100644 index 0000000..e4b26b5 --- /dev/null +++ b/upstream/vendor/nextcloud/lint-stylelint.yml @@ -0,0 +1,53 @@ +# This workflow is provided via the organization template repository +# +# 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 stylelint + +on: pull_request + +permissions: + contents: read + +concurrency: + group: lint-stylelint-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + + name: stylelint + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + id: versions + with: + fallbackNode: '^24' + fallbackNpm: '^11.3' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + + - name: Install dependencies + env: + CYPRESS_INSTALL_BINARY: 0 + run: npm ci + + - name: Lint + run: npm run stylelint diff --git a/upstream/vendor/nextcloud/npm-build.yml b/upstream/vendor/nextcloud/npm-build.yml new file mode 100644 index 0000000..c608572 --- /dev/null +++ b/upstream/vendor/nextcloud/npm-build.yml @@ -0,0 +1,113 @@ +# This workflow is provided via the organization template repository +# +# 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: Build Javascript + +on: pull_request + +permissions: + contents: read + +concurrency: + group: node-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + changes: + runs-on: ubuntu-latest-low + permissions: + contents: read + pull-requests: read + + outputs: + src: ${{ steps.changes.outputs.src}} + + steps: + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + id: changes + continue-on-error: true + with: + filters: | + src: + - '.github/workflows/**' + - 'src/**' + - 'appinfo/info.xml' + - 'package.json' + - 'package-lock.json' + - 'tsconfig.json' + - '**.js' + - '**.ts' + - '**.vue' + + build: + runs-on: ubuntu-latest + + needs: changes + if: needs.changes.outputs.src != 'false' + + name: NPM build + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + id: versions + with: + fallbackNode: '^24' + fallbackNpm: '^11.3' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + + - name: Validate package-lock.json # See https://github.com/npm/cli/issues/4460 + run: | + npm i -g npm-package-lock-add-resolved@1.1.4 + npm-package-lock-add-resolved + git --no-pager diff --exit-code + + - name: Install dependencies & build + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: | + npm ci + npm run build --if-present + + - name: Check build changes + run: | + bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)" + + - name: Show changes on failure + if: failure() + run: | + git status + git --no-pager diff + exit 1 # make it red to grab attention + + summary: + permissions: + contents: none + runs-on: ubuntu-latest-low + needs: [changes, build] + + if: always() + + # This is the summary, we just avoid to rename it so that branch protection rules still match + name: node + + steps: + - name: Summary status + run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi diff --git a/upstream/vendor/nextcloud/openapi.yml b/upstream/vendor/nextcloud/openapi.yml new file mode 100644 index 0000000..7485656 --- /dev/null +++ b/upstream/vendor/nextcloud/openapi.yml @@ -0,0 +1,96 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2024 Arthur Schiwon +# SPDX-License-Identifier: MIT + +name: OpenAPI + +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: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 + + - name: Set up php + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + 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 if no package.json + 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@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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 dependencies + if: ${{ steps.node_versions.outputs.nodeVersion }} + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: | + npm ci + + - name: Install composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + + - name: Regenerate OpenAPI + run: composer run openapi + + - 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 section \"Show changes on failure\" for details' && exit 1)" + + - name: Show changes on failure + if: failure() + run: | + git status + git --no-pager diff + exit 1 # make it red to grab attention diff --git a/upstream/vendor/nextcloud/psalm.yml b/upstream/vendor/nextcloud/psalm.yml new file mode 100644 index 0000000..d6e2d52 --- /dev/null +++ b/upstream/vendor/nextcloud/psalm.yml @@ -0,0 +1,61 @@ +# This workflow is provided via the organization template repository +# +# 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 + +concurrency: + group: psalm-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read + +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: nextcloud-libraries/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@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + 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: Remove nextcloud/ocp + run: | + composer remove nextcloud/ocp --dev --no-scripts + + - name: Install composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + + - name: Install nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} + 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