-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (55 loc) · 1.58 KB
/
build.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
name: build
on: [push, pull_request]
env:
HUSKY: 0
jobs:
test:
name: Build, lint, and test on Node.js ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 16, 18]
steps:
- uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install npm >= v7
run: npm install -g "npm@>=7"
- name: Install dependencies
run: npm ci
- name: Check types
run: npm run tsc --workspaces
- name: Lint
run: npm run lint
- name: Run tests
run: npm run test --workspace=main -- --ci --coverage --maxWorkers=2
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: main/
- name: Build
run: npm run build --workspace=main
- name: Build the docs
run: npm run docs
release:
name: Release
runs-on: ubuntu-latest
needs: test
if: github.repository_owner == 'bjoluc' && github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build --workspace=main
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run release --workspace=main