Skip to content

Commit

Permalink
ci(jest): split jest tests to run in multiple shards (#3912)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeartSquared committed Jul 26, 2023
1 parent 5c3fa76 commit 115fc56
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .changeset/cuddly-experts-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
69 changes: 63 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,83 @@ jobs:
- uses: ./.github/actions/setup
- run: yarn lint:styles

jest-react-16:
jest-react-16--1:
name: jest-react-16
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn ci:test:react-16
- run: yarn ci:test:react-16 --shard=1/2

jest-react-17:
jest-react-16--2:
name: jest-react-16
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn ci:test:react-17
- run: yarn ci:test:react-16 --shard=2/2

jest-react-18:
jest-react-16--aio:
name: jest-react-16
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn ci:test
- run: yarn pkg:aio ci:test:react-16

jest-react-17--1:
name: jest-react-17
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn ci:test:react-17 --shard=1/2

jest-react-17--2:
name: jest-react-17
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn ci:test:react-17 --shard=2/2

jest-react-17--aio:
name: jest-react-17
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn pkg:aio ci:test:react-17

jest-react-18--1:
name: jest-react-18
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn test:ci --shard=1/2

jest-react-18--2:
name: jest-react-18
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn test:ci --shard=2/2

jest-react-18--aio:
name: jest-react-18
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn pkg:aio test:ci
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
"plop": "plop",
"pkg:c-library": "yarn workspace @kaizen/component-library",
"pkg:aio": "yarn workspace @kaizen/components",
"ci:test": "yarn test:ci && yarn pkg:aio test:ci",
"ci:test:react-16": "USE_REACT_16=true yarn test:ci && yarn pkg:aio ci:test:react-16",
"ci:test:react-17": "USE_REACT_17=true yarn test:ci && yarn pkg:aio ci:test:react-17",
"ci:test:react-16": "USE_REACT_16=true yarn test:ci",
"ci:test:react-17": "USE_REACT_17=true yarn test:ci",
"ci:version": "yarn turbo prepublish && yarn changeset version",
"ci:publish": "yarn turbo prepublish && yarn changeset publish"
},
Expand Down

0 comments on commit 115fc56

Please sign in to comment.