-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (87 loc) · 2.19 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Continuous integration
on:
push:
branches-ignore:
- 'gh-pages'
tags-ignore:
- '*'
jobs:
install:
name: 'install'
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-verion: '12.x'
- name: Cache npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: v1-npm-${{ github.ref }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
v1-npm-${{ github.ref }}-
v1-npm-
- name: Restore node_modules
id: node-modules-cache
uses: actions/cache@v2
with:
path: node_modules
key: v1-node-modules-${{ github.ref }}-${{ hashFiles('package-lock.json') }}
- name: Install
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci
lint:
name: 'lint'
runs-on: ubuntu-18.04
needs:
- install
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-verion: '12.x'
- name: Restore node_modules
uses: actions/cache@v2
id: node-modules-cache
with:
path: node_modules
key: v1-node-modules-${{ github.ref }}-${{ hashFiles('package-lock.json') }}
- name: Lint
run: npm run lint:js
test:
name: 'test'
runs-on: ubuntu-18.04
needs:
- install
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-verion: '12.x'
- name: Restore node_modules
uses: actions/cache@v2
id: node-modules-cache
with:
path: node_modules
key: v1-node-modules-${{ github.ref }}-${{ hashFiles('package-lock.json') }}
- name: Test
run: npm run test:js
build:
name: 'build'
runs-on: ubuntu-18.04
needs:
- install
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-verion: '12.x'
- name: Restore node_modules
uses: actions/cache@v2
id: node-modules-cache
with:
path: node_modules
key: v1-node-modules-${{ github.ref }}-${{ hashFiles('package-lock.json') }}
- name: Build
run: npm run build