@@ -18,13 +18,22 @@ jobs:
18
18
steps :
19
19
- uses : actions/checkout@v4
20
20
21
- # - uses: actions/setup-go@v5
22
- - uses : erezrokah/setup-go@feat/add_cache_prefix
21
+ - uses : actions/setup-go@v5
23
22
with :
24
23
go-version : ${{ env.GO_VERSION }}
25
- cache-key-prefix : clean-cache-
24
+ cache : false
26
25
id : go
27
26
27
+ - uses : actions/cache@v4
28
+ with :
29
+ path : |
30
+ ~/.cache/go-build
31
+ ~/go/pkg/mod
32
+ key : ${{ runner.os }}-go-clean-${{ hashFiles('**/go.sum') }}
33
+ restore-keys : |
34
+ ${{ runner.os }}-go-clean-
35
+ ${{ runner.os }}-go-
36
+
28
37
- name : Install tools
29
38
run : make install
30
39
@@ -47,12 +56,22 @@ jobs:
47
56
steps :
48
57
- uses : actions/checkout@v4
49
58
50
- - uses : erezrokah /setup-go@feat/add_cache_prefix
59
+ - uses : actions /setup-go@v5
51
60
with :
52
61
go-version : ${{ env.GO_VERSION }}
53
- cache-key-prefix : build-cache-
62
+ cache : false
54
63
id : go
55
64
65
+ - uses : actions/cache@v4
66
+ with :
67
+ path : |
68
+ ~/.cache/go-build
69
+ ~/go/pkg/mod
70
+ key : ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
71
+ restore-keys : |
72
+ ${{ runner.os }}-go-build-
73
+ ${{ runner.os }}-go-
74
+
56
75
- uses : actions/setup-node@v4
57
76
with :
58
77
node-version : " 18"
@@ -70,13 +89,22 @@ jobs:
70
89
steps :
71
90
- uses : actions/checkout@v4
72
91
73
- # - uses: actions/setup-go@v5
74
- - uses : erezrokah/setup-go@feat/add_cache_prefix
92
+ - uses : actions/setup-go@v5
75
93
with :
76
94
go-version : ${{ env.GO_VERSION }}
77
- cache-key-prefix : test-cache-
95
+ cache : false
78
96
id : go
79
97
98
+ - uses : actions/cache@v4
99
+ with :
100
+ path : |
101
+ ~/.cache/go-build
102
+ ~/go/pkg/mod
103
+ key : ${{ runner.os }}-go-test-${{ hashFiles('**/go.sum') }}
104
+ restore-keys : |
105
+ ${{ runner.os }}-go-test-
106
+ ${{ runner.os }}-go-
107
+
80
108
- name : Test
81
109
run : mkdir dist && touch dist/empty && make test
82
110
@@ -93,12 +121,24 @@ jobs:
93
121
cache : false # avoid cache thrashing
94
122
id : go
95
123
124
+ - uses : actions/cache@v4
125
+ with :
126
+ path : |
127
+ ~/.cache/go-build
128
+ ~/go/pkg/mod
129
+ key : ${{ runner.os }}-go-lint-${{ hashFiles('**/go.sum') }}
130
+ restore-keys : |
131
+ ${{ runner.os }}-go-lint-
132
+ ${{ runner.os }}-go-
133
+
96
134
- run : mkdir dist && touch dist/empty
97
135
98
136
- name : Lint
99
137
uses : golangci/golangci-lint-action@v4
100
138
with :
101
139
version : latest
140
+ skip-pkg-cache : true
141
+ skip-build-cache : true
102
142
args : --out-format=colored-line-number --timeout 5m
103
143
104
144
ui :
@@ -139,16 +179,31 @@ jobs:
139
179
integration :
140
180
name : Integration
141
181
runs-on : ubuntu-latest
182
+ strategy :
183
+ fail-fast : false
184
+ matrix :
185
+ shardIndex : [1, 2]
186
+ shardTotal : [2]
142
187
143
188
steps :
144
189
- uses : actions/checkout@v4
145
190
146
- - uses : erezrokah /setup-go@feat/add_cache_prefix
191
+ - uses : actions /setup-go@v5
147
192
with :
148
193
go-version : ${{ env.GO_VERSION }}
149
- cache-key-prefix : integration-cache-
194
+ cache : false
150
195
id : go
151
196
197
+ - uses : actions/cache@v4
198
+ with :
199
+ path : |
200
+ ~/.cache/go-build
201
+ ~/go/pkg/mod
202
+ key : ${{ runner.os }}-go-integration-${{ hashFiles('**/go.sum') }}
203
+ restore-keys : |
204
+ ${{ runner.os }}-go-integration-
205
+ ${{ runner.os }}-go-
206
+
152
207
- uses : actions/setup-node@v4
153
208
with :
154
209
node-version : " 18"
@@ -160,15 +215,27 @@ jobs:
160
215
- name : Build Go
161
216
run : make build
162
217
218
+ - uses : actions/cache@v4
219
+ id : playwright-cache
220
+ with :
221
+ path : |
222
+ ~/.cache/ms-playwright
223
+ key : ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
224
+
163
225
- name : Install playwright
164
226
run : npx playwright install --with-deps chromium
165
227
166
228
- name : Run tests
167
- run : npx playwright test
229
+ run : npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
230
+
231
+ # - name: Run tests
232
+ # uses: docker://mcr.microsoft.com/playwright:v1.34.3-jammy
233
+ # with:
234
+ # args: npx playwright test
168
235
169
236
- uses : actions/upload-artifact@v4
170
- if : always()
237
+ if : ${{ !cancelled() }}
171
238
with :
172
- name : playwright-report
239
+ name : playwright-report-${{ matrix.shardIndex }}
173
240
path : playwright-report/
174
241
retention-days : 14
0 commit comments