Skip to content

Commit f9b3eb5

Browse files
committed
ci: separate testing for environments
1 parent 12e265f commit f9b3eb5

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

.github/workflows/test.yml

+27-11
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,47 @@ on:
77
- '**/tsconfig.json'
88
- 'tests/**/*.ts'
99
- 'src/**/*.ts'
10-
- 'jest.config.js'
10+
- 'jest.config.ts'
1111
- 'package-lock.json'
1212
branches:
1313
- main
1414
- 'release/*'
1515

1616
jobs:
17-
jest:
18-
timeout-minutes: 10
17+
setup-test:
1918
if: github.event.pull_request.draft == false
2019
runs-on: ubuntu-latest
21-
strategy:
22-
matrix:
23-
# current and active LTS
24-
node: [ 18, 19 ]
2520
concurrency:
2621
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2722
cancel-in-progress: true
2823
steps:
2924
- uses: actions/checkout@v3
25+
26+
- name: Install dependencies
27+
run: npm ci --ignore-scripts
28+
jest-browser:
29+
needs: setup-test
30+
timeout-minutes: 10
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/setup-node@v3
34+
with:
35+
cache: 'npm'
36+
node-version: 'latest'
37+
- name: Run tests on jsdom
38+
run: jest --selectProjects=jsdom
39+
jest-node:
40+
needs: setup-test
41+
timeout-minutes: 10
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
# current and active LTS
46+
node: [ 18, 19 ]
47+
steps:
3048
- uses: actions/setup-node@v3
3149
with:
3250
cache: 'npm'
3351
node-version: ${{ matrix.node }}
34-
- name: Install dependencies
35-
run: npm ci --ignore-scripts
36-
- name: Run tests
37-
run: npm run test
52+
- name: Run tests on node v${{ matrix.node }}
53+
run: jest --selectProjects=node

0 commit comments

Comments
 (0)