DAW#68 Fix Cypress CI workflow #3
Workflow file for this run
This file contains 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: E2E Tests (Cypress) | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
jobs: | ||
cypress-run: | ||
runs-on: ubuntu-latest | ||
# Runs tests in parallel with matrix strategy https://docs.cypress.io/guides/guides/parallelization | ||
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs | ||
# Also see warning here https://github.com/cypress-io/github-action#parallel | ||
strategy: | ||
fail-fast: false # https://github.com/cypress-io/github-action/issues/48 | ||
matrix: | ||
node-version: [16.x] | ||
containers: [1, 2] # Uses 2 parallel instances | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Cypress run | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm run build | ||
start: npm start | ||
wait-on: "http://localhost:3000" # Waits for above | ||
record: true # Cypress cloud | ||
parallel: true # Runs test in parallel using settings above | ||
env: | ||
# Set in GitHub repo → Settings → Secrets → Actions | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |