File tree 2 files changed +45
-4
lines changed
2 files changed +45
-4
lines changed Original file line number Diff line number Diff line change 8
8
NODE_VERSION : " 12.x"
9
9
10
10
jobs :
11
- eslint :
12
- name : Eslint
11
+ setup :
12
+ name : Setup
13
13
runs-on : ubuntu-latest
14
14
timeout-minutes : 5
15
15
steps :
16
16
- uses : actions/checkout@v2
17
- with :
18
- fetch-depth : 0
19
17
20
18
- uses : actions/setup-node@v1
21
19
with :
22
20
node-version : " ${{ env.NODE_VERSION }}"
23
21
24
22
- name : Cache node modules
23
+ id : cache
25
24
uses : actions/cache@v1
26
25
with :
27
26
path : node_modules
31
30
if : steps.cache.outputs.cache-hit != 'true'
32
31
run : npm ci
33
32
33
+ eslint :
34
+ name : Eslint
35
+ runs-on : ubuntu-latest
36
+ needs : [setup]
37
+ timeout-minutes : 5
38
+ steps :
39
+ - uses : actions/checkout@v2
40
+ with :
41
+ fetch-depth : 0
42
+
43
+ - uses : actions/setup-node@v1
44
+ with :
45
+ node-version : " ${{ env.NODE_VERSION }}"
46
+
34
47
- name : Fetch all branches
35
48
run : |
36
49
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
37
50
51
+ - name : Cache node modules
52
+ uses : actions/cache@v1
53
+ with :
54
+ path : node_modules
55
+ key : ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
56
+
38
57
- name : ESLint
39
58
run : npm run ci:lint -- $(git diff --diff-filter d --name-only origin/${{ github.base_ref }}...HEAD -- '*.js' '*.ts' '*.tsx')
59
+
60
+ tests :
61
+ name : Tests
62
+ runs-on : ubuntu-latest
63
+ needs : [setup]
64
+ timeout-minutes : 5
65
+ steps :
66
+ - uses : actions/checkout@v2
67
+
68
+ - uses : actions/setup-node@v1
69
+ with :
70
+ node-version : " ${{ env.NODE_VERSION }}"
71
+
72
+ - name : Cache node modules
73
+ uses : actions/cache@v1
74
+ with :
75
+ path : node_modules
76
+ key : ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
77
+
78
+ - name : unit tests
79
+ run : npm run ci:test
Original file line number Diff line number Diff line change 9
9
"lint" : " eslint 'src/**/*.js' --quiet --fix" ,
10
10
"clean" : " rimraf ./dist ./.cache" ,
11
11
"ci:lint" : " eslint 'src/**/*.js' -c ./.eslintrc.js" ,
12
+ "ci:test" : " jest --ci" ,
12
13
"test" : " jest" ,
13
14
"test:watch" : " jest --watch"
14
15
},
You can’t perform that action at this time.
0 commit comments