-
-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (55 loc) · 1.55 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Test
on:
pull_request:
types: [ready_for_review, opened, synchronize, reopened]
paths:
- '**/tsconfig.json'
- 'tests/**/*.ts'
- 'src/**/*.ts'
- 'jest.config.ts'
- 'package-lock.json'
branches:
- main
- 'release/*'
jobs:
setup-test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
# subsequent calls to this action will use already downloaded code from the workspace
- uses: actions/checkout@v3
jest-browser:
needs: setup-test
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: 'latest'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run tests on jsdom
run: npx jest --selectProjects=jsdom
jest-node:
needs: setup-test
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
# current and active LTS
node: [ 20, 21 ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run tests on node v${{ matrix.node }}
run: npx jest --selectProjects=node