99 - " *"
1010
1111env :
12- # go needs absolute directories, using the $HOME variable doesn't work here.
13- DOWNLOAD_CACHE : /home/runner/work/download_cache
14-
1512 # If you change this value, please change it in the following files as well:
1613 # /Dockerfile
1714 # /dev.Dockerfile
@@ -31,33 +28,15 @@ jobs:
3128 os : [ubuntu-latest, windows-latest, macOS-latest]
3229
3330 steps :
34- - name : set git config
35- run : |
36- git config --global core.eol lf
37- git config --global core.autocrlf false
38-
3931 - name : git checkout
40- uses : actions/checkout@v2
41-
42- - name : setup nodejs v${{ matrix.node_version }}
43- uses : actions/setup-node@v1
32+ uses : actions/checkout@v3
4433 with :
45- node-version : ${{ matrix.node_version }}
46-
47- - name : get yarn cache dir
48- id : yarn-cache-dir
49- run : echo "::set-output name=dir::$(yarn cache dir)"
34+ fetch-depth : 0
5035
51- - name : yarn cache
52- uses : actions/cache@v2
53- id : yarn-cache
36+ - name : setup nodejs ${{ matrix.node_version }}
37+ uses : ./.github/actions/setup-node
5438 with :
55- path : ${{ steps.yarn-cache-dir.outputs.dir }}
56- key : ${{ runner.os }}-yarn-${{ matrix.node_version }}-${{ hashFiles('**/yarn.lock') }}
57- restore-keys : |
58- ${{ runner.os }}-yarn-${{ matrix.node_version }}-${{ hashFiles('**/yarn.lock') }}
59- ${{ runner.os }}-yarn-${{ matrix.node_version }}-
60- ${{ runner.os }}-yarn-
39+ node-version : ' ${{ matrix.node_version }}'
6140
6241 - name : install dependencies
6342 working-directory : ./app
@@ -88,43 +67,20 @@ jobs:
8867 os : [ubuntu-latest, windows-latest, macOS-latest]
8968
9069 steps :
91- - name : Set git to use LF
92- run : |
93- git config --global core.eol lf
94- git config --global core.autocrlf false
95-
9670 - name : git checkout
97- uses : actions/checkout@v2
98-
99- - name : go cache
100- uses : actions/cache@v2
71+ uses : actions/checkout@v3
10172 with :
102- path : ~/go/pkg/mod
103- key : ${{ runner.os }}-go-${{ matrix.go_version }}-${{ hashFiles('**/go.sum') }}
104- restore-keys : |
105- ${{ runner.os }}-go-${{ matrix.go_version }}-${{ hashFiles('**/go.sum') }}
106- ${{ runner.os }}-go-${{ matrix.go_version }}-
107- ${{ runner.os }}-go-
108-
109- - name : get yarn cache dir
110- id : yarn-cache-dir
111- run : echo "::set-output name=dir::$(yarn cache dir)"
112-
113- - name : yarn cache
114- uses : actions/cache@v2
115- id : yarn-cache
73+ fetch-depth : 0
74+
75+ - name : setup nodejs ${{ matrix.node_version }}
76+ uses : ./.github/actions/setup-node
11677 with :
117- path : ${{ steps.yarn-cache-dir.outputs.dir }}
118- key : ${{ runner.os }}-yarn-16.x-${{ hashFiles('**/yarn.lock') }}
119- restore-keys : |
120- ${{ runner.os }}-yarn-16.x-${{ hashFiles('**/yarn.lock') }}
121- ${{ runner.os }}-yarn-16.x-
122- ${{ runner.os }}-yarn-
123-
124- - name : setup go v${{ matrix.go_version }}
125- uses : actions/setup-go@v2
78+ node-version : ' ${{ matrix.node_version }}'
79+
80+ - name : setup go ${{ env.GO_VERSION }}
81+ uses : ./.github/actions/setup-go
12682 with :
127- go-version : ' ~ ${{ matrix.go_version }}'
83+ go-version : ' ${{ env.GO_VERSION }}'
12884
12985 - name : build backend binary
13086 run : make build
@@ -139,52 +95,25 @@ jobs:
13995 name : RPC proto compilation check
14096 runs-on : ubuntu-latest
14197 steps :
142- - name : set git config
143- run : |
144- git config --global core.eol lf
145- git config --global core.autocrlf false
146-
14798 - name : git checkout
148- uses : actions/checkout@v2
149-
150- - name : setup nodejs v16.x
151- uses : actions/setup-node@v1
99+ uses : actions/checkout@v3
152100 with :
153- node-version : 16.x
101+ fetch-depth : 0
154102
155- - name : download cache
156- uses : actions/cache@v1
103+ - name : setup nodejs ${{ matrix.node_version }}
104+ uses : ./.github/ actions/setup-node
157105 with :
158- path : /home/runner/work/download_cache
159- key : litd-${{ runner.os }}-download-${{ hashFiles('**/install_protoc.sh') }}
160- restore-keys : |
161- litd-${{ runner.os }}-download-${{ hashFiles('**/install_protoc.sh') }}
162- litd-${{ runner.os }}-download-
163-
164- - name : get yarn cache dir
165- id : yarn-cache-dir
166- run : echo "::set-output name=dir::$(yarn cache dir)"
167-
168- - name : yarn cache
169- uses : actions/cache@v2
170- id : yarn-cache
106+ node-version : ' ${{ matrix.node_version }}'
107+
108+ - name : setup go ${{ env.GO_VERSION }}
109+ uses : ./.github/actions/setup-go
171110 with :
172- path : ${{ steps.yarn-cache-dir.outputs.dir }}
173- key : ${{ runner.os }}-yarn-${{ matrix.node_version }}-${{ hashFiles('**/yarn.lock') }}
174- restore-keys : |
175- ${{ runner.os }}-yarn-${{ matrix.node_version }}-${{ hashFiles('**/yarn.lock') }}
176- ${{ runner.os }}-yarn-${{ matrix.node_version }}-
177- ${{ runner.os }}-yarn-
111+ go-version : ' ${{ env.GO_VERSION }}'
178112
179113 - name : install dependencies
180114 working-directory : ./app
181115 run : yarn
182116
183- - name : setup go ${{ env.GO_VERSION }}
184- uses : actions/setup-go@v2
185- with :
186- go-version : ' ${{ env.GO_VERSION }}'
187-
188117 - name : compile rpc for golang
189118 run : make rpc
190119
@@ -200,23 +129,12 @@ jobs:
200129 runs-on : ubuntu-latest
201130 steps :
202131 - name : git checkout
203- uses : actions/checkout@v2
132+ uses : actions/checkout@v3
204133 with :
205134 fetch-depth : 0
206135
207- - name : go cache
208- uses : actions/cache@v1
209- with :
210- path : /home/runner/work/go
211- key : litd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
212- restore-keys : |
213- litd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
214- litd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
215- litd-${{ runner.os }}-go-${{ env.GO_VERSION }}-
216- litd-${{ runner.os }}-go-
217-
218136 - name : setup go ${{ env.GO_VERSION }}
219- uses : actions/setup-go@v2
137+ uses : ./.github/ actions/setup-go
220138 with :
221139 go-version : ' ${{ env.GO_VERSION }}'
222140
@@ -239,12 +157,12 @@ jobs:
239157 runs-on : ubuntu-latest
240158 steps :
241159 - name : git checkout
242- uses : actions/checkout@v2
160+ uses : actions/checkout@v3
243161 with :
244162 fetch-depth : 0
245163
246164 - name : setup go ${{ env.GO_VERSION }}
247- uses : actions/setup-go@v2
165+ uses : ./.github/ actions/setup-go
248166 with :
249167 go-version : ' ${{ env.GO_VERSION }}'
250168
@@ -262,12 +180,12 @@ jobs:
262180 runs-on : ubuntu-latest
263181 steps :
264182 - name : git checkout
265- uses : actions/checkout@v2
183+ uses : actions/checkout@v3
266184 with :
267185 fetch-depth : 0
268186
269187 - name : setup go ${{ env.GO_VERSION }}
270- uses : actions/setup-go@v2
188+ uses : ./.github/ actions/setup-go
271189 with :
272190 go-version : ' ${{ env.GO_VERSION }}'
273191
@@ -282,12 +200,12 @@ jobs:
282200 runs-on : ubuntu-latest
283201 steps :
284202 - name : git checkout
285- uses : actions/checkout@v2
203+ uses : actions/checkout@v3
286204 with :
287205 fetch-depth : 0
288206
289207 - name : setup go ${{ env.GO_VERSION }}
290- uses : actions/setup-go@v2
208+ uses : ./.github/ actions/setup-go
291209 with :
292210 go-version : ' ${{ env.GO_VERSION }}'
293211
@@ -301,51 +219,24 @@ jobs:
301219 name : integration test
302220 runs-on : ubuntu-latest
303221 steps :
304- - name : set git config
305- run : |
306- git config --global core.eol lf
307- git config --global core.autocrlf false
308-
309222 - name : git checkout
310- uses : actions/checkout@v2
311-
312- - name : setup nodejs v${{ matrix.node_version }}
313- uses : actions/setup-node@v1
223+ uses : actions/checkout@v3
314224 with :
315- node-version : 16.x
225+ fetch-depth : 0
316226
317- - name : download cache
318- uses : actions/cache@v1
227+ - name : setup nodejs ${{ matrix.node_version }}
228+ uses : ./.github/ actions/setup-node
319229 with :
320- path : /home/runner/work/download_cache
321- key : litd-${{ runner.os }}-download-${{ hashFiles('**/install_protoc.sh') }}
322- restore-keys : |
323- litd-${{ runner.os }}-download-${{ hashFiles('**/install_protoc.sh') }}
324- litd-${{ runner.os }}-download-
325-
326- - name : get yarn cache dir
327- id : yarn-cache-dir
328- run : echo "::set-output name=dir::$(yarn cache dir)"
329-
330- - name : yarn cache
331- uses : actions/cache@v2
332- id : yarn-cache
230+ node-version : ' ${{ matrix.node_version }}'
231+
232+ - name : setup go ${{ env.GO_VERSION }}
233+ uses : ./.github/actions/setup-go
333234 with :
334- path : ${{ steps.yarn-cache-dir.outputs.dir }}
335- key : ${{ runner.os }}-yarn-${{ matrix.node_version }}-${{ hashFiles('**/yarn.lock') }}
336- restore-keys : |
337- ${{ runner.os }}-yarn-${{ matrix.node_version }}-${{ hashFiles('**/yarn.lock') }}
338- ${{ runner.os }}-yarn-${{ matrix.node_version }}-
339- ${{ runner.os }}-yarn-
235+ go-version : ' ${{ env.GO_VERSION }}'
340236
341237 - name : install dependencies
342238 working-directory : ./app
343239 run : yarn
344240
345- - name : setup go ${{ env.GO_VERSION }}
346- uses : actions/setup-go@v2
347- with :
348- go-version : ' ${{ env.GO_VERSION }}'
349-
350241 - name : run check
351242 run : make itest
0 commit comments