diff --git a/.github/actions-lock.txt b/.github/actions-lock.txt index 0478fc833..6dce6bbab 100644 --- a/.github/actions-lock.txt +++ b/.github/actions-lock.txt @@ -1,20 +1,21 @@ # SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors # SPDX-License-Identifier: MIT -25fc4c7e69e778e20bdc9eb0cc96367e block-merge-freeze.yml -5a7b85f72877c560683ba523ffad11cc block-unconventional-commits.yml -47319d4424574e468e7d0692fd0c61d3 command-compile.yml +acad44f3e99b665897766ce90374dd03 block-merge-freeze.yml +19ab9c47c8d96de93f37fab242c398cc block-unconventional-commits.yml +83fc862cd4312894dfd2be81fb88c0b5 command-compile.yml 4cb6e4935d3f2bc1e3c99c77739118ca cypress.yml e6351c608939c31ae1e32923aa82aa10 dependabot-approve-merge.yml 2581a67c5bcdcd570427e6d51db767d7 fixup.yml -2a205b6cc57c26c31a18a7f41190f3e2 lint-eslint.yml -660a12f14e32c1b2d24c418232d918da lint-php-cs.yml -ee2b04d185b82fe7dd6fe6d83c6c7b45 lint-php.yml -351799835db66dd8d20e324970490e96 lint-stylelint.yml +92d7708f80f4e09d3aeb7d1d93168988 lint-eslint.yml +230493ed3855e3f7d9209cc63e9dbe13 lint-php-cs.yml +994cce702e8c1ec02e45e113e48512b6 lint-php.yml +ef5d06d720012cc3ea8fa9396682a133 lint-stylelint.yml c965845a0def7b39d872e47e93dd1139 node.yml -7e9fa275fffbfef58e6348a44750e2ec npm-audit-fix.yml -d1821b8a816578070ed8fd018f321f6d pr-feedback.yml -87bff1e6b8ae3ec6522b134a3d0f7a1c psalm.yml -3975dc58817119d596a8f6ed190352ce reuse.yml -9799b1a6a842b5c0076b76de651a0e0d sync-workflow-templates.yml +b7e9debcd278ab33bbe8e272e010d8e0 npm-audit-fix.yml +2639f2b96989a4fcbb441ca8f1fecb2f pr-feedback.yml +dc1f60c242a2377a0de26a521c68b49a psalm.yml +2dbec18233063b42f4d8e03bbb43671c reuse.yml +0bb535f552ee8f94dae6eeb16f7f4a4e sync-workflow-templates.yml 22604c31b526de270a080eb19967a638 update-stable-titles.yml -fcdb95d98ab64de64587191bbd71b2cb npm-build.yml +e93653cbfe2a909ca78415e656dbfa01 npm-build.yml +24e22c1cb2f2b5797d64ff650dc762dc playwright.yml diff --git a/.github/workflows/block-merge-freeze.yml b/.github/workflows/block-merge-freeze.yml index 3a9d5cc37..e6652565b 100644 --- a/.github/workflows/block-merge-freeze.yml +++ b/.github/workflows/block-merge-freeze.yml @@ -54,4 +54,4 @@ jobs: - name: Run check if: ${{ env.server_ref != '' }} - run: cat version.php | grep 'OC_VersionString' | grep -i -v 'RC' + run: cat version.php | grep 'OC_VersionString' | grep -i -v -E '(\.0\.0 RC[3-9]|\.[1-9][0-9]* RC)' diff --git a/.github/workflows/block-unconventional-commits.yml b/.github/workflows/block-unconventional-commits.yml index bcc722a61..4972f8bb3 100644 --- a/.github/workflows/block-unconventional-commits.yml +++ b/.github/workflows/block-unconventional-commits.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/command-compile.yml b/.github/workflows/command-compile.yml index 3a0da7a05..222576cf7 100644 --- a/.github/workflows/command-compile.yml +++ b/.github/workflows/command-compile.yml @@ -8,7 +8,7 @@ name: Compile Command on: - issue_comment: + issue_comment: # zizmor: ignore[dangerous-triggers] types: [created] permissions: @@ -103,7 +103,7 @@ jobs: key: git-repo - name: Checkout ${{ needs.init.outputs.head_ref }} - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false token: ${{ secrets.COMMAND_BOT_PAT }} @@ -116,20 +116,17 @@ jobs: git config --local user.name 'nextcloud-command' - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 id: package-engines-versions - with: - fallbackNode: '^24' - fallbackNpm: '^11.3' - - name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }} - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - name: Set up node ${{ steps.package-engines-versions.outputs.node-version }} + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: - node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }} + node-version: ${{ steps.package-engines-versions.outputs.node-version }} cache: npm - - name: Set up npm ${{ steps.package-engines-versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.package-engines-versions.outputs.npmVersion }}' + - name: Set up npm ${{ steps.package-engines-versions.outputs.package-manager-version }} + run: npm i -g 'npm@${{ steps.package-engines-versions.outputs.package-manager-version }}' - name: Rebase to ${{ needs.init.outputs.base_ref }} if: ${{ contains(needs.init.outputs.arg1, 'rebase') }} diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml index 3e34f7e8c..c1353ce58 100644 --- a/.github/workflows/lint-eslint.yml +++ b/.github/workflows/lint-eslint.yml @@ -28,7 +28,7 @@ jobs: src: ${{ steps.changes.outputs.src}} steps: - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 id: changes continue-on-error: true with: @@ -56,24 +56,21 @@ jobs: steps: - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + 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 + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 id: versions - with: - fallbackNode: '^24' - fallbackNpm: '^11.3' - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - name: Set up node ${{ steps.versions.outputs.node-version }} + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: - node-version: ${{ steps.versions.outputs.nodeVersion }} + node-version: ${{ steps.versions.outputs.node-version }} - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + - name: Set up npm ${{ steps.versions.outputs.package-manager-version }} + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' - name: Install dependencies env: diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml index 0a65977be..6c924112d 100644 --- a/.github/workflows/lint-php-cs.yml +++ b/.github/workflows/lint-php-cs.yml @@ -25,16 +25,16 @@ jobs: steps: - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Get php version id: versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 + 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 + uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.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 diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml index cb2684b24..53b6f38ec 100644 --- a/.github/workflows/lint-php.yml +++ b/.github/workflows/lint-php.yml @@ -25,13 +25,13 @@ jobs: php-max: ${{ steps.versions.outputs.php-max }} steps: - name: Checkout app - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Get version matrix id: versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 + uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 php-lint: runs-on: ubuntu-latest-low @@ -44,12 +44,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + 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 + uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.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 diff --git a/.github/workflows/lint-stylelint.yml b/.github/workflows/lint-stylelint.yml index 7a1457c8c..fd5580530 100644 --- a/.github/workflows/lint-stylelint.yml +++ b/.github/workflows/lint-stylelint.yml @@ -25,24 +25,21 @@ jobs: steps: - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + 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 + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 id: versions - with: - fallbackNode: '^24' - fallbackNpm: '^11.3' - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - name: Set up node ${{ steps.versions.outputs.node-version }} + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: - node-version: ${{ steps.versions.outputs.nodeVersion }} + node-version: ${{ steps.versions.outputs.node-version }} - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + - name: Set up npm ${{ steps.versions.outputs.package-manager-version }} + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' - name: Install dependencies env: diff --git a/.github/workflows/npm-audit-fix.yml b/.github/workflows/npm-audit-fix.yml index 470fb72ea..f34c17741 100644 --- a/.github/workflows/npm-audit-fix.yml +++ b/.github/workflows/npm-audit-fix.yml @@ -11,57 +11,88 @@ name: Npm audit fix and compile on: workflow_dispatch: schedule: - # At 2:30 on Sundays - - cron: '30 2 * * 0' + # At 22:30 on Saturdays + - cron: '30 22 * * 6' permissions: - contents: read + contents: write + pull-requests: write jobs: build: runs-on: ubuntu-latest + env: + # env variable for maintainers: 'false' disables auto-merge for these pull requests + AUTOMERGE: true + strategy: fail-fast: false matrix: branches: - ${{ github.event.repository.default_branch }} + - 'stable35' - 'stable34' - 'stable33' - - 'stable32' name: npm-audit-fix-${{ matrix.branches }} steps: - name: Checkout id: checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false ref: ${{ matrix.branches }} continue-on-error: true + - name: Check for active merge freeze + id: freeze + if: steps.checkout.outcome == 'success' + env: + BRANCH_NAME: ${{ matrix.branches }} + run: | + if [[ ! -f .github/workflows/block-merge-freeze.yml ]]; then + echo 'No block-merge-freeze workflow, continuing' + exit 0 + fi + if [[ "$BRANCH_NAME" == 'main' || "$BRANCH_NAME" == 'master' ]]; then + SERVER_REF='master' + elif [[ "$BRANCH_NAME" =~ ^stable[0-9]+$ ]]; then + SERVER_REF="$BRANCH_NAME" + else + echo 'Not based on master/main/stable*, so skipping freeze check' + exit 0 + fi + curl -sf "https://raw.githubusercontent.com/nextcloud/server/$SERVER_REF/version.php" --output version.php + if grep 'OC_VersionString' version.php | grep -q -i -E '(\.0\.0 RC[3-9]|\.[1-9][0-9]* RC)'; then + echo "Merge freeze is active for $SERVER_REF, skipping" + echo 'active=true' >> $GITHUB_OUTPUT + fi + rm version.php + - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + if: steps.freeze.outputs.active != 'true' + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 id: versions - with: - fallbackNode: '^24' - fallbackNpm: '^11.3' - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - name: Set up node ${{ steps.versions.outputs.node-version }} + if: steps.freeze.outputs.active != 'true' + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: - node-version: ${{ steps.versions.outputs.nodeVersion }} + node-version: ${{ steps.versions.outputs.node-version }} - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + - name: Set up npm ${{ steps.versions.outputs.package-manager-version }} + if: steps.freeze.outputs.active != 'true' + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' - name: Fix npm audit id: npm-audit + if: steps.freeze.outputs.active != 'true' uses: nextcloud-libraries/npm-audit-action@1b1728b2b4a7a78d69de65608efcf4db0e3e42d0 # v0.2.0 - name: Run npm ci and npm run build - if: steps.checkout.outcome == 'success' + if: steps.freeze.outputs.active != 'true' && steps.checkout.outcome == 'success' env: CYPRESS_INSTALL_BINARY: 0 run: | @@ -69,7 +100,8 @@ jobs: npm run build --if-present - name: Create Pull Request - if: steps.checkout.outcome == 'success' + id: create-pull-request + if: steps.freeze.outputs.active != 'true' && steps.checkout.outcome == 'success' uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 with: token: ${{ secrets.COMMAND_BOT_PAT }} @@ -83,3 +115,19 @@ jobs: labels: | dependencies 3. to review + + # Approve using the default GITHUB_TOKEN, as the PR itself was created + # using COMMAND_BOT_PAT and GitHub does not allow an account to approve its own PR + - name: GitHub actions bot approve + if: steps.freeze.outputs.active != 'true' && steps.create-pull-request.outputs.pull-request-operation != 'none' + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{ steps.create-pull-request.outputs.pull-request-url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Enable auto merge + if: steps.freeze.outputs.active != 'true' && steps.create-pull-request.outputs.pull-request-operation != 'none' && fromJSON(env.AUTOMERGE) + uses: peter-evans/enable-pull-request-automerge@a660677d5469627102a1c1e11409dd063606628d # v3.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + pull-request-number: ${{ steps.create-pull-request.outputs.pull-request-number }} diff --git a/.github/workflows/npm-build.yml b/.github/workflows/npm-build.yml index ffc89199b..22783c4a1 100644 --- a/.github/workflows/npm-build.yml +++ b/.github/workflows/npm-build.yml @@ -28,7 +28,7 @@ jobs: src: ${{ steps.changes.outputs.src}} steps: - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 id: changes continue-on-error: true with: @@ -53,24 +53,21 @@ jobs: name: NPM build steps: - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + 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 + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 id: versions - with: - fallbackNode: '^24' - fallbackNpm: '^11.3' - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - name: Set up node ${{ steps.versions.outputs.node-version }} + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: - node-version: ${{ steps.versions.outputs.nodeVersion }} + node-version: ${{ steps.versions.outputs.node-version }} - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + - name: Set up npm ${{ steps.versions.outputs.package-manager-version }} + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' - name: Validate package-lock.json # See https://github.com/npm/cli/issues/4460 run: | diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 347a869d4..9eaa4d558 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,106 +1,208 @@ +# 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: 2026 Nextcloud GmbH and Nextcloud contributors # SPDX-License-Identifier: MIT -name: Playwright - -on: pull_request +# This workflow runs Playwright tests on pull requests to the master and stable branches. +# It expects the following npm scripts to be defined in package.json: +# - "playwright": runs the Playwright tests +# - "playwright:install-ci": installs the Playwright browsers for CI (optional) +# +# If you only use the "Desktop Chrome" browser with "channel: chrome" in your Playwright config, +# you can skip the "playwright:install-ci" script as the GitHub Actions runner already has Chrome Browser installed. +# +# For merging the reports, it expects a Playwright merge config file at tests/playwright/merge.config.ts. +# You can adjust the path in the "Merge into HTML Report" step if you have a different location for the merge config file. +# The default configuration would look like this: +# ```js +# export default { +# testDir: 'tests/playwright/e2e', // path to your Playwright tests +# reporter: [['html', { open: 'never' }]], +# } +# ``` + +name: Playwright Tests + +on: + pull_request: + branches: + - main + - master + - stable35 + - stable34 + - stable33 +permissions: + contents: read concurrency: group: playwright-${{ github.head_ref || github.run_id }} cancel-in-progress: true -permissions: - contents: read - -env: - APP_NAME: ${{ github.event.repository.name }} - BRANCH: ${{ github.base_ref || github.ref_name }} - jobs: - playwright: + playwright-setup: + timeout-minutes: 10 + name: Playwright setup runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 + id: versions + - name: Check composer.json + id: check_composer + uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 + with: + files: 'composer.json' + - name: Install composer dependencies + if: steps.check_composer.outputs.files_exists == 'true' + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + with: + composer-options: '--no-dev' + - name: Set up node + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: ${{ steps.versions.outputs.node-version }} + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' + - name: Install dependencies and build + run: | + npm ci + npm run build --if-present + - name: Save context + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + key: playwright-context-${{ github.run_id }} + path: ./ + + playwright-tests: + needs: [playwright-setup] + timeout-minutes: 30 + name: Playwright tests ${{ matrix.shardIndex }} / ${{ matrix.shardTotal }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + shardIndex: [1, 2] # adjust to your needs + shardTotal: [2] + outputs: + node-version: ${{ steps.versions.outputs.node-version }} + package-manager-version: ${{ steps.versions.outputs.package-manager-version }} - name: Playwright E2E tests + steps: + - name: Restore context + id: cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + key: playwright-context-${{ github.run_id }} + path: ./ + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + if: steps.cache.outputs.cache-hit != 'true' + with: + persist-credentials: false + + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 + id: versions + + - name: Set up node + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: ${{ steps.versions.outputs.node-version }} + + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' + + - name: Install dependencies and build + if: steps.cache.outputs.cache-hit != 'true' + run: | + npm ci + npm run build --if-present + + - name: Install Playwright browsers + run: npm run playwright:install-ci --if-present + + - name: Run Playwright tests + run: npm run playwright -- --shard='${{ matrix.shardIndex }}/${{ matrix.shardTotal }}' + + - name: Upload blob report to GitHub Actions Artifacts + if: ${{ !cancelled() }} + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: blob-report-${{ matrix.shardIndex }} + path: blob-report + retention-days: 1 + + merge-reports: + # Merge reports after playwright-tests, even if some shards have failed + if: ${{ !cancelled() }} + needs: [playwright-tests] + runs-on: ubuntu-latest-low steps: - - name: Disabled on forks - if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} - run: | - echo 'Can not run Playwright on forks' - exit 1 - - - name: Checkout app - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - - name: Check composer.json - id: check_composer - uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 - with: - files: 'composer.json' - - - name: Install composer dependencies - if: steps.check_composer.outputs.files_exists == 'true' - run: composer install --no-dev - - - 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' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.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 & build app - run: | - npm ci - TESTING=true npm run build --if-present - - - name: Install Playwright browsers - run: npx playwright install chromium --with-deps - - - name: Run Playwright tests - run: npx playwright test - env: - BRANCH: ${{ env.BRANCH }} - CI: true - - - name: Show Nextcloud logs on failure - if: failure() - run: | - docker exec nextcloud-e2e-test-server_${{ env.APP_NAME }} cat data/nextcloud.log || true - - - name: Upload Playwright report - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 - if: ${{ !cancelled() }} - with: - name: playwright-report - path: playwright-report/ - retention-days: 7 - if-no-files-found: ignore - - - name: Upload Playwright traces - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 - if: failure() - with: - name: playwright-traces - path: test-results/ - retention-days: 7 - if-no-files-found: ignore + - name: Restore context + id: cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + key: playwright-context-${{ github.run_id }} + path: ./ + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + if: steps.cache.outputs.cache-hit != 'true' + with: + persist-credentials: false + + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + if: steps.cache.outputs.cache-hit != 'true' + with: + node-version: ${{ needs.playwright-tests.outputs.node-version }} + + - name: Set up npm + if: steps.cache.outputs.cache-hit != 'true' + run: npm i -g 'npm@${{ needs.playwright-tests.outputs.package-manager-version }}' + + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: npm ci + + - name: Download blob reports from GitHub Actions Artifacts + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + path: all-blob-reports + pattern: blob-report-* + merge-multiple: true + + - name: Merge into HTML Report + run: npx playwright merge-reports --config tests/playwright/merge.config.ts --reporter html,github ./all-blob-reports + + - name: Upload HTML report + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: html-report--attempt-${{ github.run_attempt }} + path: playwright-report + retention-days: 7 + + - name: How to show the logs + run: | + echo 'To view the report:' + echo ' 1. Extract the folder from the zip file' + echo ' 2. run "npx playwright show-report name-of-my-extracted-playwright-report"' summary: + permissions: + contents: none runs-on: ubuntu-latest-low - needs: playwright + needs: [playwright-tests] + if: always() - name: playwright-summary + + name: playwright-test-summary + steps: - name: Summary status - run: if ${{ needs.playwright.result != 'success' && needs.playwright.result != 'skipped' }}; then exit 1; fi + run: if ${{ needs.playwright-tests.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/pr-feedback.yml b/.github/workflows/pr-feedback.yml index 4420bf692..e93d2be9b 100644 --- a/.github/workflows/pr-feedback.yml +++ b/.github/workflows/pr-feedback.yml @@ -36,7 +36,7 @@ jobs: blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -) echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT" - - uses: nextcloud/pr-feedback-action@5227c55be184087d0aef6338bee210d8620b6297 # v1.0.1 + - uses: nextcloud-libraries/pr-feedback-action@4738cf661995d96df3512409ec17c900a4081d33 # v2.0.0 with: feedback-message: | Hello there, @@ -50,6 +50,6 @@ jobs: (If you believe you should not receive this message, you can add yourself to the [blocklist](https://github.com/nextcloud/.github/blob/master/non-community-usernames.txt).) days-before-feedback: 14 - start-date: '2025-06-12' + max-days-overdue: 7 exempt-authors: '${{ steps.blocklist.outputs.blocklist }},${{ steps.scrape.outputs.users }}' exempt-bots: true diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 4feadcb8f..8500151dd 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -24,19 +24,19 @@ jobs: name: static-psalm-analysis steps: - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Get php version id: versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 + 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 + uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.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 diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index 4e1a74194..67fdafc44 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest-low steps: - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/sync-workflow-templates.yml b/.github/workflows/sync-workflow-templates.yml index 85090be9b..5d84aec2f 100644 --- a/.github/workflows/sync-workflow-templates.yml +++ b/.github/workflows/sync-workflow-templates.yml @@ -12,7 +12,7 @@ name: Update workflows on: workflow_dispatch: schedule: - - cron: "5 2 * * 0" + - cron: "45 22 * * 6" permissions: contents: read @@ -26,9 +26,9 @@ jobs: matrix: branches: - ${{ github.event.repository.default_branch }} + - 'stable35' - 'stable34' - 'stable33' - - 'stable32' name: Update workflows in ${{ matrix.branches }} @@ -43,20 +43,45 @@ jobs: require: admin - name: Checkout workflow repository - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false path: source repository: nextcloud/.github - name: Checkout app - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false path: target ref: ${{ matrix.branches }} + - name: Check for active merge freeze + id: freeze + env: + BRANCH_NAME: ${{ matrix.branches }} + run: | + if [[ ! -f target/.github/workflows/block-merge-freeze.yml ]]; then + echo 'No block-merge-freeze workflow, continuing' + exit 0 + fi + if [[ "$BRANCH_NAME" == 'main' || "$BRANCH_NAME" == 'master' ]]; then + SERVER_REF='master' + elif [[ "$BRANCH_NAME" =~ ^stable[0-9]+$ ]]; then + SERVER_REF="$BRANCH_NAME" + else + echo 'Not based on master/main/stable*, so skipping freeze check' + exit 0 + fi + curl -sf "https://raw.githubusercontent.com/nextcloud/server/$SERVER_REF/version.php" --output version.php + if grep 'OC_VersionString' version.php | grep -q -i -E '(\.0\.0 RC[3-9]|\.[1-9][0-9]* RC)'; then + echo "Merge freeze is active for $SERVER_REF, skipping" + echo 'active=true' >> $GITHUB_OUTPUT + fi + rm version.php + - name: Copy all workflow templates + if: steps.freeze.outputs.active != 'true' run: | echo 'SUMMARY<> $GITHUB_ENV draft_only=0 @@ -121,6 +146,7 @@ jobs: echo "DRAFT_ONLY=${draft_only}" >> $GITHUB_ENV - name: Create Pull Request + if: steps.freeze.outputs.active != 'true' uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 with: token: ${{ secrets.COMMAND_BOT_WORKFLOWS }}