File tree 3 files changed +80
-39
lines changed
3 files changed +80
-39
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+
3
+ on :
4
+ pull_request :
5
+ types : [opened, synchronize, reopened]
6
+
7
+ env :
8
+ NODE_VERSION : " 12.x"
9
+
10
+ jobs :
11
+ setup :
12
+ name : Setup
13
+ runs-on : ubuntu-latest
14
+ timeout-minutes : 5
15
+ steps :
16
+ - uses : actions/checkout@v2
17
+
18
+ - uses : actions/setup-node@v1
19
+ with :
20
+ node-version : " ${{ env.NODE_VERSION }}"
21
+
22
+ - name : Cache node modules
23
+ id : cache
24
+ uses : actions/cache@v1
25
+ with :
26
+ path : node_modules
27
+ key : ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
28
+
29
+ - name : Install Dependencies
30
+ if : steps.cache.outputs.cache-hit != 'true'
31
+ run : npm ci
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
+
47
+ - name : Fetch all branches
48
+ run : |
49
+ git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
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
+
57
+ - name : Run Eslint
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 : Run Tests
79
+ run : npm run ci:test
Load Diff This file was deleted.
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