Commit 089fba5d authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

test: parallelize cypress (again) with a consistent container (#6182)

* Revert "test: run cypress on one machine (#6181)"

This reverts commit a2812fcf.

* test: use consistent container across cypress-test-matrix

* test: condition cypress-tests on cypress-test-matrix

* test: check cypress-test-matrix

* debug: cypress-test-matrix.result

* test: fix error

* test: fix error

* test: fix error

* test: fix error

* test: fix error

* test: fix error
parent 503a3331
...@@ -62,9 +62,30 @@ jobs: ...@@ -62,9 +62,30 @@ jobs:
- run: yarn test:size - run: yarn test:size
cypress-tests: cypress-build:
needs: [build] runs-on: ubuntu-latest
container: cypress/browsers:node-18.14.1-chrome-111.0.5563.64-1-ff-111.0-edge-111.0.1661.43-1
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- uses: actions/cache@v3
id: cypress-cache
with:
path: /root/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('yarn.lock') }}
- if: steps.cypress-cache.outputs.cache-hit != 'true'
run: |
yarn cypress install
yarn cypress info
cypress-test-matrix:
needs: [build, cypress-build]
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: cypress/browsers:node-18.14.1-chrome-111.0.5563.64-1-ff-111.0-edge-111.0.1661.43-1
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
...@@ -72,12 +93,11 @@ jobs: ...@@ -72,12 +93,11 @@ jobs:
with: with:
name: build name: build
path: build path: build
- uses: actions/cache@v3 - uses: actions/cache@v3
id: cypress-cache id: cypress-cache
with: with:
path: /home/runner/.cache/Cypress path: /root/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('node_modules/cypress') }} key: ${{ runner.os }}-cypress-${{ hashFiles('yarn.lock') }}
- if: steps.cypress-cache.outputs.cache-hit != 'true' - if: steps.cypress-cache.outputs.cache-hit != 'true'
run: yarn cypress install run: yarn cypress install
...@@ -88,6 +108,16 @@ jobs: ...@@ -88,6 +108,16 @@ jobs:
wait-on: 'http://localhost:3000' wait-on: 'http://localhost:3000'
browser: chrome browser: chrome
record: true record: true
parallel: true
env: env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Included as a single job to check for cypress-test-matrix success, as a matrix cannot be checked.
cypress-tests:
if: ${{ always() }}
needs: [cypress-test-matrix]
runs-on: ubuntu-latest
steps:
- if: needs.cypress-test-matrix.result != 'success'
run: exit 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment