-
Notifications
You must be signed in to change notification settings - Fork 114
79 lines (77 loc) · 2.2 KB
/
tests.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Tests
on:
push:
branches:
- master
pull_request: {}
jobs:
lint:
name: Lint
uses: the-guild-org/shared-config/.github/workflows/lint.yml@main
with:
script: yarn ci:lint
secrets:
githubToken: ${{ secrets.GITHUB_TOKEN }}
build:
name: Type Check on GraphQL v${{matrix.graphql_version}}
runs-on: ubuntu-latest
strategy:
matrix:
graphql_version:
- 15
- 16
steps:
- name: Checkout Master
uses: actions/checkout@v3
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 18
- name: Use GraphQL v${{matrix.graphql_version}}
run: node ./scripts/match-graphql.js ${{matrix.graphql_version}}
- name: Type Check
run: yarn ts:check
test:
name: Unit Test on Node ${{matrix.node-version}} (${{matrix.os}}) and GraphQL v${{matrix.graphql_version}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest] # remove windows to speed up the tests
node-version: [12, 16, 18]
graphql_version:
- 15
- 16
steps:
- name: Checkout Master
uses: actions/checkout@v3
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 18
- name: Use GraphQL v${{matrix.graphql_version}}
run: node ./scripts/match-graphql.js ${{matrix.graphql_version}}
- name: Cache Jest
uses: actions/cache@v3
with:
path: .cache/jest
key: ${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-jest-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-jest-
- name: Test
run: yarn test --ci
env:
CI: true
test_esm:
name: ESM Test
runs-on: ubuntu-latest
steps:
- name: Checkout Master
uses: actions/checkout@v3
- name: Setup env
uses: the-guild-org/shared-config/setup@main
with:
nodeVersion: 18
- name: Build Packages
run: yarn build
- name: Test ESM
run: node scripts/test-esm.mjs