[stable35] Fix npm audit #170
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | |
| # SPDX-License-Identifier: MIT | |
| name: Playwright | |
| on: pull_request | |
| 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: | |
| runs-on: ubuntu-latest | |
| name: Playwright E2E tests | |
| 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 | |
| summary: | |
| runs-on: ubuntu-latest-low | |
| needs: playwright | |
| if: always() | |
| name: playwright-summary | |
| steps: | |
| - name: Summary status | |
| run: if ${{ needs.playwright.result != 'success' && needs.playwright.result != 'skipped' }}; then exit 1; fi |