-
Notifications
You must be signed in to change notification settings - Fork 17
76 lines (62 loc) · 1.88 KB
/
ci.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
on:
push:
branches: [main]
pull_request:
jobs:
typecheck-outputs:
name: 🚚 Typecheck Outputs / ${{ matrix.typescript-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
typescript-version:
- '~5.2.0'
- '~5.1.0'
# We use features that were added in v5.0 of typescript, so that is
# the lowest we can go here. This also means this is the lowest
# version we support. When this value changes in the future it needs
# to be communicated to the users.
- '~5.0.0'
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: 🪡 Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: 📦 Install Dependencies
run: npm install
# Order is important here, we build with the typescript version defined
# in package.json, before we overrite it for the tests.
- name: 🏗️ Build
run: npm run build
- name: 📘 Install Typescript
run: npm install --dev typescript@${{ matrix.typescript-version }}
- name: 🔎 Type check
run: npm run tsc:dist
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.0
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: 🪡 Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: 📦 Install Dependencies
run: npm install
- name: ⚡ Run tests
run: |
npm run test
- name: 🚦 Lint
run: |
npm run lint
- name: 🧙🏿♂️ TSC
run: |
npm run tsc
- name: 📥 Generate npm package
run: |
npm run build