File tree 1 file changed +21
-7
lines changed
1 file changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -2,31 +2,45 @@ name: CI
2
2
3
3
on :
4
4
push :
5
- branches : " master"
5
+ branches : master
6
6
pull_request :
7
7
branches : " *"
8
8
9
9
jobs :
10
10
11
11
build :
12
- name : ubuntu-latest ${{ matrix.config .go_version }}
12
+ name : ${{ matrix.os }} - Go ${{ matrix.go_version }}
13
13
runs-on : ubuntu-latest
14
14
strategy :
15
+ # If you want to matrix build , you can append the following list.
15
16
matrix :
16
- config :
17
- - go_version : 1.13
18
- - go_version : 1.14
17
+ go_version :
18
+ - 1.13
19
+ - 1.14
20
+ os :
21
+ - ubuntu-latest
22
+
19
23
steps :
20
24
21
- - name : Set up Go 1.x
25
+ - name : Set up Go ${{ matrix.go_version }}
22
26
uses : actions/setup-go@v2
23
27
with :
24
- go-version : ${{ matrix.config. go_version }}
28
+ go-version : ${{ matrix.go_version }}
25
29
id : go
26
30
27
31
- name : Check out code into the Go module directory
28
32
uses : actions/checkout@v2
29
33
34
+ - name : Cache build dependence
35
+ uses : actions/cache@v2
36
+ with :
37
+ # Cache
38
+ path : ~/go/pkg/mod
39
+ # Cache key
40
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
41
+ # An ordered list of keys to use for restoring the cache if no cache hit occurred for key
42
+ restore-keys : ${{ runner.os }}-go-
43
+
30
44
- name : Install goimports
31
45
run : go get golang.org/x/tools/cmd/goimports
32
46
You can’t perform that action at this time.
0 commit comments