9393 strategy :
9494 fail-fast : false
9595 matrix :
96- # Run multiple copies of the current job in parallel
97- # Please increase the number or runners as your tests suite grows
98- containers : ['component', '1', '2', '3']
96+ # Please increase the number or runners as your tests suite grows (0 based index for e2e tests)
97+ containers : [0, 1, 2, 3, 4, 5, 6, 7]
98+ # Hack as strategy.job-total includes the component and GitHub does not allow math expressions
99+ # Always align this number with the total of e2e runners (max. index + 1)
100+ total-containers : [8]
99101
100102 name : runner ${{ matrix.containers }}
101103
@@ -115,17 +117,18 @@ jobs:
115117 - name : Set up npm ${{ needs.init.outputs.npmVersion }}
116118 run : npm i -g 'npm@${{ needs.init.outputs.npmVersion }}'
117119
120+ - name : Install cypress
121+ run : ./node_modules/cypress/bin/cypress install
122+
118123 - name : Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }} cypress tests
119124 uses : cypress-io/github-action@783cb3f07983868532cabaedaa1e6c00ff4786a8 # v7.1.9
120125 with :
121- record : ${{ secrets.CYPRESS_RECORD_KEY && true }} # zizmor: ignore[secrets-outside-env]
122- parallel : ${{ secrets.CYPRESS_RECORD_KEY && true }} # zizmor: ignore[secrets-outside-env]
126+ # We already installed the dependencies in the init job
127+ install : false
123128 # cypress run type
124129 component : ${{ matrix.containers == 'component' }}
125- group : ${{ secrets.CYPRESS_RECORD_KEY && env.CYPRESS_GROUP }} # zizmor: ignore[secrets-outside-env]
126- # cypress env
127- ci-build-id : ${{ secrets.CYPRESS_RECORD_KEY && env.CYPRESS_BUILD_ID }} # zizmor: ignore[secrets-outside-env]
128- tag : ${{ secrets.CYPRESS_RECORD_KEY && github.event_name }} # zizmor: ignore[secrets-outside-env]
130+ # Do not add Cypress record key config as this conflicts with cypress-split
131+ # Cypress again tries to force users to buy their dashboard...
129132 env :
130133 # Needs to be prefixed with CYPRESS_
131134 CYPRESS_BRANCH : ${{ env.BRANCH }}
@@ -134,9 +137,8 @@ jobs:
134137 # Needed for some specific code workarounds
135138 TESTING : true
136139 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
137- CYPRESS_RECORD_KEY : ${{ secrets.CYPRESS_RECORD_KEY }} # zizmor: ignore[secrets-outside-env]
138- CYPRESS_BUILD_ID : ${{ github.sha }}-${{ github.run_number }}
139- CYPRESS_GROUP : Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }}
140+ SPLIT : ${{ matrix.total-containers }}
141+ SPLIT_INDEX : ${{ matrix.containers == 'component' && 0 || matrix.containers }}
140142
141143 - name : Upload snapshots
142144 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
0 commit comments