run tests in parallel across 3 machines #12
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: Run API tests | |
on: push | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-22.04 | |
strategy: | |
# when one test fails, DO NOT cancel the other | |
# containers, because this will kill Cypress processes | |
# leaving Cypress Cloud hanging ... | |
# https://github.com/cypress-io/github-action/issues/48 | |
fail-fast: false | |
matrix: | |
# run 3 copies of the current job in parallel | |
containers: [1, 2, 3] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cypress run | |
uses: cypress-io/github-action@v6 | |
with: | |
browser: chrome | |
start: npm start | |
# quote the url to be safe against YML parsing surprises | |
wait-on: "http://localhost:3001" | |
record: true | |
parallel: true | |
group: "Actions example" | |
env: | |
# pass GitHub token to allow accurately detecting a build vs a re-run build | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# pass the Cypress Cloud record key as an environment variable | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
# pass the project ID from the secrets through environment variable | |
CYPRESS_PROJECT_ID: ${{ secrets.PROJECT_ID }} |