-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (53 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
name: Test
on:
push:
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
build-ui:
name: UI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: "~/.npm"
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: install
run: npm ci && (cd source/ui && npm ci)
- name: build
run: npm run build-ui
build-server:
name: Server
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16, 18, 20]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
# don't discriminate by ${{ matrix.node-version }}
with:
path: "~/.npm"
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: install
run: npm ci && (cd source/server && npm ci)
- name: test
run: (cd source/server && npm test)
- name: build
run: npm run build-server