chore: replace BrowserStack with Cypress cross-browser matrix #5
Workflow file for this run
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
| name: Cross-Browser Tests | |
| on: | |
| merge_group: | |
| workflow_dispatch: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| env: | |
| NODE_VERSION: 22 | |
| jobs: | |
| build: | |
| name: Build Package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - name: Build package | |
| uses: ./.github/actions/build | |
| with: | |
| node: ${{ env.NODE_VERSION }} | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: dist-${{ github.run_id }} | |
| path: dist | |
| retention-days: 1 | |
| cross-browser: | |
| needs: build | |
| name: ${{ matrix.browser }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 25 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest] | |
| browser: [chrome, edge, firefox] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: dist-${{ github.run_id }} | |
| path: dist | |
| - name: Setup Node and npm | |
| uses: ./.github/actions/setup-node-npm | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install dependencies | |
| run: npm i | |
| - name: Run cross-browser tests | |
| uses: cypress-io/github-action@v7 | |
| with: | |
| browser: ${{ matrix.browser }} | |
| start: npm run start:local | |
| wait-on: 'http://127.0.0.1:4200' | |
| spec: projects/playground/e2e/integration/playground.cy.ts | |
| config-file: cypress.config.js | |
| install-command: npx cypress install | |
| - name: Upload Cypress screenshots | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: cypress-screenshots-${{ matrix.browser }}-${{ github.run_id }} | |
| path: projects/playground/e2e/screenshots | |
| retention-days: 30 | |
| if-no-files-found: ignore |