feat: Viewer 7.0.0 #172
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: 2024 Nextcloud GmbH and Nextcloud contributors | |
| # SPDX-License-Identifier: MIT | |
| name: Playwright Tests | |
| on: | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| playwright-tests: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shardIndex: [1, 2] | |
| shardTotal: [2] | |
| steps: | |
| - name: Checkout app | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Check composer.json | |
| id: check_composer | |
| uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2 | |
| 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 | |
| uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 | |
| id: versions | |
| - name: Set up node | |
| uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.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 node dependencies & build app | |
| run: | | |
| npm ci | |
| npm run build --if-present | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: Run Playwright tests | |
| run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} | |
| - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| if: ${{ !cancelled() }} | |
| 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: Checkout app | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - 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@395ad3262231945c25e8478fd5baf05154b1d79f # v6.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 | |
| run: npm ci | |
| - name: Download blob reports from GitHub Actions Artifacts | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| path: all-blob-reports | |
| pattern: blob-report-* | |
| merge-multiple: true | |
| - name: Merge into HTML Report | |
| run: npx playwright merge-reports --config playwright/merge.config.ts ./all-blob-reports | |
| - name: Upload HTML report | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: html-report--attempt-${{ github.run_attempt }} | |
| path: playwright-report | |
| retention-days: 14 |