diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-10-21 18:33:05 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-10-21 18:42:08 +0200 |
commit | 37d53d6b7972862657c3a077dd3c74abda65e966 (patch) | |
tree | 3d953d4ed74326de89c5d8d2644ef358b85e60a5 /.github/workflows/cypress.yml | |
parent | 5c2610af7dbce72fa1c1b02185a2c28cd5be004e (diff) | |
download | nextcloud-server-37d53d6b7972862657c3a077dd3c74abda65e966.tar.gz nextcloud-server-37d53d6b7972862657c3a077dd3c74abda65e966.zip |
feat(cypress): Always run cypress CI in parallel (independent from cypress.io)
The server always exceeds the free Cypress.io time so there is no benefit using it
unless we go for the enterprise plan.
So this simply uses `cypress-split` to split the specs and run them in parallel CI workers (only e2e tests).
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to '.github/workflows/cypress.yml')
-rw-r--r-- | .github/workflows/cypress.yml | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index da653c8952d..72d2f1e24fe 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -72,15 +72,11 @@ jobs: fail-fast: false matrix: # Run multiple copies of the current job in parallel - # Please increase the number or runners as your tests suite grows - containers: ["component", 1, 2] - # Only use cypress cloud for PRs - use-cypress-cloud: - - ${{ !!github.head_ref }} - # Only use one container if we are not using the cypress cloud. - exclude: - - use-cypress-cloud: false - containers: 2 + # Please increase the number or runners as your tests suite grows (0 based index for e2e tests) + containers: ["component", 0, 1, 2] + # Hack as strategy.job-total includes the component and GitHub does not allow math expressions + # Always aling this number with the total of e2e runners (max. index + 1) + total-containers: [3] name: runner ${{ matrix.containers }} @@ -103,9 +99,6 @@ jobs: - name: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }} cypress tests uses: cypress-io/github-action@59810ebfa5a5ac6fcfdcfdf036d1cd4d083a88f2 # v6.5.0 with: - record: ${{ !!matrix.use-cypress-cloud }} - parallel: ${{ !!matrix.use-cypress-cloud }} - # cypress run type component: ${{ matrix.containers == 'component' }} group: ${{ matrix.use-cypress-cloud && matrix.containers == 'component' && 'Run component' || matrix.use-cypress-cloud && 'Run E2E' || '' }} # cypress env @@ -120,6 +113,8 @@ jobs: TESTING: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + SPLIT: ${{ matrix.total-containers }} + SPLIT_INDEX: ${{ matrix.containers == 'component' && 0 || matrix.containers }} - name: Upload snapshots uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 |