|
| 1 | +name: Cross-Browser Tests |
| 2 | + |
| 3 | +on: |
| 4 | + merge_group: |
| 5 | + workflow_dispatch: |
| 6 | + pull_request: |
| 7 | + types: |
| 8 | + - opened |
| 9 | + - synchronize |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - main |
| 13 | + |
| 14 | +permissions: |
| 15 | + contents: read |
| 16 | + |
| 17 | +concurrency: |
| 18 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 19 | + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} |
| 20 | + |
| 21 | +env: |
| 22 | + NODE_VERSION: 22 |
| 23 | + |
| 24 | +jobs: |
| 25 | + build: |
| 26 | + name: Build Package |
| 27 | + runs-on: ubuntu-latest |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: Checkout code |
| 31 | + uses: actions/checkout@v6 |
| 32 | + with: |
| 33 | + ref: ${{ github.event.pull_request.head.sha || github.ref }} |
| 34 | + |
| 35 | + - name: Build package |
| 36 | + uses: ./.github/actions/build |
| 37 | + with: |
| 38 | + node: ${{ env.NODE_VERSION }} |
| 39 | + |
| 40 | + - name: Upload build artifacts |
| 41 | + uses: actions/upload-artifact@v7 |
| 42 | + with: |
| 43 | + name: dist-${{ github.run_id }} |
| 44 | + path: dist |
| 45 | + retention-days: 1 |
| 46 | + |
| 47 | + cross-browser: |
| 48 | + needs: build |
| 49 | + name: ${{ matrix.browser }} |
| 50 | + runs-on: ${{ matrix.os }} |
| 51 | + timeout-minutes: 25 |
| 52 | + |
| 53 | + strategy: |
| 54 | + fail-fast: false |
| 55 | + matrix: |
| 56 | + os: [windows-latest] |
| 57 | + browser: [chrome, edge, firefox] |
| 58 | + |
| 59 | + steps: |
| 60 | + - name: Checkout code |
| 61 | + uses: actions/checkout@v6 |
| 62 | + with: |
| 63 | + ref: ${{ github.event.pull_request.head.sha || github.ref }} |
| 64 | + |
| 65 | + - name: Download build artifacts |
| 66 | + uses: actions/download-artifact@v8 |
| 67 | + with: |
| 68 | + name: dist-${{ github.run_id }} |
| 69 | + path: dist |
| 70 | + |
| 71 | + - name: Setup Node |
| 72 | + uses: actions/setup-node@v6 |
| 73 | + with: |
| 74 | + node-version: ${{ env.NODE_VERSION }} |
| 75 | + |
| 76 | + - name: Install dependencies |
| 77 | + run: npm i |
| 78 | + |
| 79 | + - name: Run cross-browser tests |
| 80 | + uses: cypress-io/github-action@v7 |
| 81 | + with: |
| 82 | + browser: ${{ matrix.browser }} |
| 83 | + start: npm run start:local |
| 84 | + wait-on: 'http://127.0.0.1:4200' |
| 85 | + spec: projects/playground/e2e/integration/playground.cy.ts |
| 86 | + config-file: cypress.config.js |
| 87 | + install-command: npx cypress install |
| 88 | + |
| 89 | + - name: Upload Cypress screenshots |
| 90 | + if: failure() |
| 91 | + uses: actions/upload-artifact@v7 |
| 92 | + with: |
| 93 | + name: cypress-screenshots-${{ matrix.browser }}-${{ github.run_id }} |
| 94 | + path: projects/playground/e2e/screenshots |
| 95 | + retention-days: 30 |
| 96 | + if-no-files-found: ignore |
0 commit comments