-
-
Notifications
You must be signed in to change notification settings - Fork 681
51 lines (40 loc) · 1.33 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
name: build
on: [push, pull_request]
jobs:
test:
name: Build, lint, and test on Node.js ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 16]
steps:
- uses: actions/checkout@v2
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm
- name: Install npm@v7
run: npm install -g npm@7
- name: Install dependencies
run: npm ci
# Running this after `npm ci` because `npm ci` removes `node_modules`:
- name: Download Turborepo cache
uses: actions/cache@v2
with:
path: node_modules/.cache/turbo
key: ${{ runner.os }}-node-${{ matrix.node }}-turbo-${{ hashFiles('node_modules/.cache/turbo') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-turbo-
- name: Build packages
run: npm run build
# TODO setup linting
# - name: Lint
# run: npm run lint
- name: Run tests
run: npm run test -- --ci --coverage --maxWorkers=2
env:
NODE_OPTIONS: "--max-old-space-size=4096" # Increase heap size for jest
# TODO setup codecov or coveralls
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1