1
1
on : push
2
2
3
+ concurrency :
4
+ group : ${{ github.workflow }}-${{ github.ref }}
5
+
3
6
name : CI
4
7
5
8
jobs :
@@ -10,14 +13,11 @@ jobs:
10
13
env :
11
14
LINT : 1
12
15
steps :
13
- - uses : technote-space/auto-cancel-redundant-workflow@v1
14
- with :
15
- EXCLUDE_MERGED : ' true'
16
16
- name : Set running flag
17
17
run : echo "RUNNING=1" >> $GITHUB_ENV
18
18
- uses : actions/checkout@v2
19
19
- uses : technote-space/get-git-comment-action@v1
20
- - uses : technote-space/get-diff-action@v4
20
+ - uses : technote-space/get-diff-action@v5
21
21
with :
22
22
PATTERNS : +(src|__tests__)/**/*.+(js|ts)
23
23
FILES : |
@@ -28,17 +28,10 @@ jobs:
28
28
run : echo "RUNNING=" >> $GITHUB_ENV
29
29
if : " ! env.GIT_DIFF"
30
30
31
- - name : Get Yarn Cache Directory
32
- id : yarn-cache
33
- run : echo "::set-output name=dir::$(yarn cache dir)"
34
- if : env.RUNNING
35
- - name : Cache node dependencies
36
- uses : actions/cache@v2
31
+ - uses : actions/setup-node@v2
37
32
with :
38
- path : ${{ steps.yarn-cache.outputs.dir }}
39
- key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
40
- restore-keys : |
41
- ${{ runner.os }}-yarn-
33
+ node-version : 14
34
+ cache : yarn
42
35
if : env.RUNNING
43
36
- name : Install Package dependencies
44
37
run : yarn install
@@ -57,13 +50,13 @@ jobs:
57
50
timeout-minutes : 10
58
51
strategy :
59
52
matrix :
60
- node : ['12', '14']
53
+ node : ['12', '14', '16' ]
61
54
steps :
62
55
- name : Set running flag
63
56
run : echo "RUNNING=1" >> $GITHUB_ENV
64
57
- uses : actions/checkout@v2
65
58
- uses : technote-space/get-git-comment-action@v1
66
- - uses : technote-space/get-diff-action@v4
59
+ - uses : technote-space/get-diff-action@v5
67
60
with :
68
61
PATTERNS : +(src|__tests__)/**/*.+(js|ts|snap)
69
62
FILES : |
@@ -74,33 +67,21 @@ jobs:
74
67
run : echo "RUNNING=" >> $GITHUB_ENV
75
68
if : " ! env.GIT_DIFF"
76
69
- name : Set running flag
77
- if : " matrix.node == '12 ' && ! startsWith(github.ref, 'refs/tags/') && github.event.base_ref == format('refs/heads/{0}', github.event.repository.default_branch)"
70
+ if : " matrix.node == '14 ' && ! startsWith(github.ref, 'refs/tags/') && github.event.base_ref == format('refs/heads/{0}', github.event.repository.default_branch)"
78
71
run : echo "RUNNING=1" >> $GITHUB_ENV
79
72
- name : Set running flag
80
- if : matrix.node == '12 ' && startsWith(github.ref, 'refs/tags/v')
73
+ if : matrix.node == '14 ' && startsWith(github.ref, 'refs/tags/v')
81
74
run : echo "RUNNING=1" >> $GITHUB_ENV
82
75
- name : Set running flag
83
76
run : |
84
77
if [[ ! -f package.json ]] || ! < package.json jq -r '.scripts | keys[]' | grep -qe '^cover$'; then
85
78
echo "RUNNING=" >> $GITHUB_ENV
86
79
fi
87
80
88
- - name : Setup node
89
- uses : actions/setup-node@v1
81
+ - uses : actions/setup-node@v2
90
82
with :
91
83
node-version : ${{ matrix.node }}
92
- if : env.RUNNING
93
- - name : Get Yarn Cache Directory
94
- id : yarn-cache
95
- run : echo "::set-output name=dir::$(yarn cache dir)"
96
- if : env.RUNNING
97
- - name : Cache node dependencies
98
- uses : actions/cache@v2
99
- with :
100
- path : ${{ steps.yarn-cache.outputs.dir }}
101
- key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
102
- restore-keys : |
103
- ${{ runner.os }}-yarn-
84
+ cache : yarn
104
85
if : env.RUNNING
105
86
- name : Install Package dependencies
106
87
run : yarn install
116
97
env :
117
98
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
118
99
COVERAGE_FILE : ./coverage/lcov.info
119
- if : env.RUNNING && matrix.node == '12 '
100
+ if : env.RUNNING && matrix.node == '14 '
120
101
121
102
package :
122
103
name : Publish Package
@@ -139,6 +120,11 @@ jobs:
139
120
NPM_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
140
121
- uses : actions/checkout@v2
141
122
if : env.RUNNING
123
+ - name : Check package version
124
+ uses : technote-space/package-version-check-action@v1
125
+ with :
126
+ COMMIT_DISABLED : 1
127
+ if : env.RUNNING
142
128
- name : Set running flag
143
129
run : npx can-npm-publish || echo "RUNNING=" >> $GITHUB_ENV
144
130
if : env.RUNNING && matrix.target == 'npm'
@@ -154,34 +140,19 @@ jobs:
154
140
if : env.RUNNING && matrix.target == 'gpr'
155
141
156
142
- name : Setup Node.js
157
- uses : actions/setup-node@v1
143
+ uses : actions/setup-node@v2
158
144
with :
159
- node-version : 12
145
+ node-version : 14
160
146
registry-url : https://registry.npmjs.org/
147
+ cache : yarn
161
148
if : env.RUNNING && matrix.target == 'npm'
162
149
- name : Setup Node.js
163
- uses : actions/setup-node@v1
150
+ uses : actions/setup-node@v2
164
151
with :
165
- node-version : 12
152
+ node-version : 14
166
153
registry-url : https://npm.pkg.github.com
154
+ cache : yarn
167
155
if : env.RUNNING && matrix.target == 'gpr'
168
- - name : Get Yarn Cache Directory
169
- id : yarn-cache
170
- run : echo "::set-output name=dir::$(yarn cache dir)"
171
- if : env.RUNNING
172
- - name : Cache node dependencies
173
- uses : actions/cache@v2
174
- with :
175
- path : ${{ steps.yarn-cache.outputs.dir }}
176
- key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
177
- restore-keys : |
178
- ${{ runner.os }}-yarn-
179
- if : env.RUNNING
180
- - name : Check package version
181
- uses : technote-space/package-version-check-action@v1
182
- with :
183
- COMMIT_DISABLED : 1
184
- if : env.RUNNING
185
156
- name : Install Package dependencies
186
157
run : yarn install
187
158
if : env.RUNNING
@@ -235,7 +206,7 @@ jobs:
235
206
timeout-minutes : 3
236
207
if : always()
237
208
steps :
238
- - uses : technote-space/workflow-conclusion-action@v1
209
+ - uses : technote-space/workflow-conclusion-action@v2
239
210
- uses : 8398a7/action-slack@v3
240
211
with :
241
212
status : failure
0 commit comments