@@ -27,21 +27,15 @@ jobs:
27
27
- name : Cache Go
28
28
id : module-cache
29
29
uses : actions/cache@v2
30
- env :
31
- cache-name : cache-go-modules
32
30
with :
33
- path : |
34
- /home/runner/go/pkg/mod
35
- /home/runner/.cache/go-build
31
+ path : /home/runner/go/pkg/mod
36
32
key : go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
37
33
- name : Install dependencies
38
34
if : steps.module-cache.outputs.cache-hit != 'true'
39
35
run : make gomoddownload
40
36
- name : Cache Tools
41
37
id : tool-cache
42
38
uses : actions/cache@v2
43
- env :
44
- cache-name : cache-tool-binaries
45
39
with :
46
40
path : /home/runner/go/bin
47
41
key : tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }}
@@ -65,18 +59,12 @@ jobs:
65
59
- name : Cache Go
66
60
id : module-cache
67
61
uses : actions/cache@v2
68
- env :
69
- cache-name : cache-go-modules
70
62
with :
71
- path : |
72
- /home/runner/go/pkg/mod
73
- /home/runner/.cache/go-build
63
+ path : /home/runner/go/pkg/mod
74
64
key : go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
75
65
- name : Cache Tools
76
66
id : tool-cache
77
67
uses : actions/cache@v2
78
- env :
79
- cache-name : cache-tool-binaries
80
68
with :
81
69
path : /home/runner/go/bin
82
70
key : tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }}
@@ -113,21 +101,20 @@ jobs:
113
101
- name : Cache Go
114
102
id : module-cache
115
103
uses : actions/cache@v2
116
- env :
117
- cache-name : cache-go-modules
118
104
with :
119
- path : |
120
- /home/runner/go/pkg/mod
121
- /home/runner/.cache/go-build
105
+ path : /home/runner/go/pkg/mod
122
106
key : go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
123
107
- name : Cache Tools
124
108
id : tool-cache
125
109
uses : actions/cache@v2
126
- env :
127
- cache-name : cache-tool-binaries
128
110
with :
129
111
path : /home/runner/go/bin
130
112
key : tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }}
113
+ - name : Cache Build
114
+ uses : actions/cache@v2
115
+ with :
116
+ path : /home/runner/.cache/go-build
117
+ key : go-build-unittest-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
131
118
- name : Run Unit Tests
132
119
run : make gotest
133
120
test-coverage :
@@ -147,21 +134,20 @@ jobs:
147
134
- name : Cache Go
148
135
id : module-cache
149
136
uses : actions/cache@v2
150
- env :
151
- cache-name : cache-go-modules
152
137
with :
153
- path : |
154
- /home/runner/go/pkg/mod
155
- /home/runner/.cache/go-build
138
+ path : /home/runner/go/pkg/mod
156
139
key : go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
157
140
- name : Cache Tools
158
141
id : tool-cache
159
142
uses : actions/cache@v2
160
- env :
161
- cache-name : cache-tool-binaries
162
143
with :
163
144
path : /home/runner/go/bin
164
145
key : tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }}
146
+ - name : Cache Build
147
+ uses : actions/cache@v2
148
+ with :
149
+ path : /home/runner/.cache/go-build
150
+ key : go-build-coverage-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
165
151
- name : Run Unit Tests With Coverage
166
152
run : make gotest-with-cover
167
153
- name : Upload coverage report
@@ -187,12 +173,8 @@ jobs:
187
173
- name : Cache Go
188
174
id : module-cache
189
175
uses : actions/cache@v2
190
- env :
191
- cache-name : cache-go-modules
192
176
with :
193
- path : |
194
- /home/runner/go/pkg/mod
195
- /home/runner/.cache/go-build
177
+ path : /home/runner/go/pkg/mod
196
178
key : go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
197
179
- name : Build Collector for All Architectures
198
180
run : make binaries-all-sys
0 commit comments