Skip to content

Commit 7de42a6

Browse files
authored
chore(): Shard unit tests jobs (medusajs#13525)
* chore(): Shard unit tests jobs * pass with no tests * try artifacts * Revert "try artifacts" This reverts commit 43663b4.
1 parent ba9a307 commit 7de42a6

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/action.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ jobs:
3939
with:
4040
extension: pipeline
4141

42-
unit-tests:
42+
unit-tests-matrix:
4343
needs: setup
44+
name: Unit Tests - Shard ${{ matrix.shard_index }}
4445
runs-on: ubuntu-latest
4546
strategy:
4647
fail-fast: true
48+
matrix:
49+
shard_index: [1, 2, 3]
4750
env:
4851
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
4952
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
@@ -63,7 +66,22 @@ jobs:
6366
extension: pipeline
6467

6568
- name: Run unit tests
66-
run: yarn test:chunk -- --maxWorkers=${{ steps.cpu-cores.outputs.count }}
69+
run: yarn test:chunk -- --shard=${{ matrix.shard_index }}/3 --maxWorkers=${{ steps.cpu-cores.outputs.count }} --passWithNoTests
70+
71+
unit-tests:
72+
if: ${{ always() }}
73+
runs-on: ubuntu-latest
74+
needs: unit-tests-matrix
75+
steps:
76+
- run: exit 1
77+
if: >-
78+
${{
79+
contains(needs.unit-tests-matrix.result, 'failure')
80+
|| contains(needs.unit-tests-matrix.result, 'cancelled')
81+
|| contains(needs.unit-tests-matrix.result, 'skipped')
82+
}}
83+
- run: exit 0
84+
if: ${{ contains(needs.unit-tests-matrix.result, 'success') }}
6785

6886
integration-tests-packages-matrix:
6987
needs: setup

0 commit comments

Comments
 (0)