11
11
env :
12
12
# Common versions
13
13
GO_VERSION : ' 1.21'
14
- GOLANGCI_VERSION : ' v1.54 .0'
14
+ GOLANGCI_VERSION : ' v1.61 .0'
15
15
DOCKER_BUILDX_VERSION : ' v0.8.2'
16
- XPKG_ACCESS_ID : ${{ secrets.XPKG_ACCESS_ID }}
16
+
17
+ # Common users. We can't run a step 'if secrets.XXX != ""' but we can run a
18
+ # step 'if env.XXX != ""', so we copy these to succinctly test whether
19
+ # credentials have been provided before trying to run steps that need them.
20
+ UPBOUND_MARKETPLACE_PUSH_ROBOT_USR : ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
17
21
18
22
jobs :
19
23
detect-noop :
20
- runs-on : ubuntu-22 .04
24
+ runs-on : ubuntu-24 .04
21
25
outputs :
22
26
noop : ${{ steps.noop.outputs.should_skip }}
23
27
steps :
29
33
paths_ignore : ' ["**.md", "**.png", "**.jpg"]'
30
34
do_not_skip : ' ["workflow_dispatch", "schedule", "push"]'
31
35
36
+ report-breaking-changes :
37
+ runs-on : ubuntu-24.04
38
+ needs : detect-noop
39
+ if : needs.detect-noop.outputs.noop != 'true'
40
+ steps :
41
+ - name : Checkout
42
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
43
+ with :
44
+ submodules : true
45
+
46
+ - name : Get modified CRDs
47
+ id : modified-crds
48
+ uses : tj-actions/changed-files@v45
49
+ with :
50
+ files : |
51
+ package/crds/**
52
+ - name : Report breaking CRD OpenAPI v3 schema changes
53
+ if : steps.modified-crds.outputs.any_changed == 'true'
54
+ env :
55
+ MODIFIED_CRD_LIST : ${{ steps.modified-crds.outputs.all_changed_files }}
56
+ run : |
57
+ make crddiff
58
+ - name : Report native schema version changes
59
+ if : ${{ inputs.upjet-based-provider }}
60
+ run : |
61
+ make schema-version-diff
62
+
32
63
lint :
33
- runs-on : ubuntu-22 .04
64
+ runs-on : ubuntu-24 .04
34
65
needs : detect-noop
35
66
if : needs.detect-noop.outputs.noop != 'true'
36
67
@@ -47,17 +78,17 @@ jobs:
47
78
48
79
- name : Find the Go Build Cache
49
80
id : go
50
- run : echo "::set-output name= cache:: $(make go.cachedir)"
81
+ run : echo "cache= $(make go.cachedir)" >> $GITHUB_OUTPUT
51
82
52
83
- name : Cache the Go Build Cache
53
- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
84
+ uses : actions/cache@v4
54
85
with :
55
86
path : ${{ steps.go.outputs.cache }}
56
87
key : ${{ runner.os }}-build-lint-${{ hashFiles('**/go.sum') }}
57
88
restore-keys : ${{ runner.os }}-build-lint-
58
89
59
90
- name : Cache Go Dependencies
60
- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
91
+ uses : actions/cache@v4
61
92
with :
62
93
path : .work/pkg
63
94
key : ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
@@ -69,12 +100,12 @@ jobs:
69
100
# We could run 'make lint' but we prefer this action because it leaves
70
101
# 'annotations' (i.e. it comments on PRs to point out linter violations).
71
102
- name : Lint
72
- uses : golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6
103
+ uses : golangci/golangci-lint-action@v6
73
104
with :
74
105
version : ${{ env.GOLANGCI_VERSION }}
75
106
76
107
check-diff :
77
- runs-on : ubuntu-22 .04
108
+ runs-on : ubuntu-24 .04
78
109
needs : detect-noop
79
110
if : needs.detect-noop.outputs.noop != 'true'
80
111
@@ -94,17 +125,17 @@ jobs:
94
125
95
126
- name : Find the Go Build Cache
96
127
id : go
97
- run : echo "::set-output name= cache:: $(make go.cachedir)"
128
+ run : echo "cache= $(make go.cachedir)" >> $GITHUB_OUTPUT
98
129
99
130
- name : Cache the Go Build Cache
100
- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
131
+ uses : actions/cache@v4
101
132
with :
102
133
path : ${{ steps.go.outputs.cache }}
103
134
key : ${{ runner.os }}-build-check-diff-${{ hashFiles('**/go.sum') }}
104
135
restore-keys : ${{ runner.os }}-build-check-diff-
105
136
106
137
- name : Cache Go Dependencies
107
- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
138
+ uses : actions/cache@v4
108
139
with :
109
140
path : .work/pkg
110
141
key : ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
@@ -117,7 +148,7 @@ jobs:
117
148
run : make check-diff
118
149
119
150
unit-tests :
120
- runs-on : ubuntu-22 .04
151
+ runs-on : ubuntu-24 .04
121
152
needs : detect-noop
122
153
if : needs.detect-noop.outputs.noop != 'true'
123
154
@@ -137,17 +168,17 @@ jobs:
137
168
138
169
- name : Find the Go Build Cache
139
170
id : go
140
- run : echo "::set-output name= cache:: $(make go.cachedir)"
171
+ run : echo "cache= $(make go.cachedir)" >> $GITHUB_OUTPUT
141
172
142
173
- name : Cache the Go Build Cache
143
- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
174
+ uses : actions/cache@v4
144
175
with :
145
176
path : ${{ steps.go.outputs.cache }}
146
177
key : ${{ runner.os }}-build-unit-tests-${{ hashFiles('**/go.sum') }}
147
178
restore-keys : ${{ runner.os }}-build-unit-tests-
148
179
149
180
- name : Cache Go Dependencies
150
- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
181
+ uses : actions/cache@v4
151
182
with :
152
183
path : .work/pkg
153
184
key : ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
@@ -160,28 +191,85 @@ jobs:
160
191
run : make -j2 test
161
192
162
193
- name : Publish Unit Test Coverage
163
- uses : codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4
194
+ uses : codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
164
195
with :
165
196
flags : unittests
166
197
file : _output/tests/linux_amd64/coverage.txt
167
198
168
- publish-artifacts :
169
- runs-on : ubuntu-22 .04
199
+ local-deploy :
200
+ runs-on : ubuntu-24 .04
170
201
needs : detect-noop
171
202
if : needs.detect-noop.outputs.noop != 'true'
172
203
204
+ steps :
205
+ - name : Checkout
206
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
207
+ with :
208
+ submodules : true
209
+
210
+ - name : Fetch History
211
+ run : git fetch --prune --unshallow
212
+
213
+ - name : Setup Go
214
+ uses : actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
215
+ with :
216
+ go-version : ${{ env.GO_VERSION }}
217
+
218
+ - name : Find the Go Build Cache
219
+ id : go
220
+ run : echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT
221
+
222
+ - name : Cache the Go Build Cache
223
+ uses : actions/cache@v4
224
+ with :
225
+ path : ${{ steps.go.outputs.cache }}
226
+ key : ${{ runner.os }}-build-unit-tests-${{ hashFiles('**/go.sum') }}
227
+ restore-keys : ${{ runner.os }}-build-unit-tests-
228
+
229
+ - name : Cache Go Dependencies
230
+ uses : actions/cache@v4
231
+ with :
232
+ path : .work/pkg
233
+ key : ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
234
+ restore-keys : ${{ runner.os }}-pkg-
235
+
236
+ - name : Vendor Dependencies
237
+ run : make vendor vendor.check
238
+
239
+ - name : Deploying locally built provider package
240
+ run : make local-deploy
241
+
242
+ publish-artifacts :
243
+ runs-on : ubuntu-24.04
244
+ needs :
245
+ - detect-noop
246
+ - report-breaking-changes
247
+ - lint
248
+ - check-diff
249
+ - unit-tests
250
+ - local-deploy
251
+ if : needs.detect-noop.outputs.noop != 'true'
252
+
173
253
steps :
174
254
- name : Setup QEMU
175
255
uses : docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
176
256
with :
177
257
platforms : all
178
258
179
259
- name : Setup Docker Buildx
180
- uses : docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3
260
+ uses : docker/setup-buildx-action@v3
181
261
with :
182
262
version : ${{ env.DOCKER_BUILDX_VERSION }}
183
263
install : true
184
264
265
+ - name : Login to Upbound
266
+ uses : docker/login-action@v3
267
+ if : env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != ''
268
+ with :
269
+ registry : xpkg.upbound.io
270
+ username : ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
271
+ password : ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }}
272
+
185
273
- name : Checkout
186
274
uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
187
275
with :
@@ -197,17 +285,17 @@ jobs:
197
285
198
286
- name : Find the Go Build Cache
199
287
id : go
200
- run : echo "::set-output name= cache:: $(make go.cachedir)"
288
+ run : echo "cache= $(make go.cachedir)" >> $GITHUB_OUTPUT
201
289
202
290
- name : Cache the Go Build Cache
203
- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
291
+ uses : actions/cache@v4
204
292
with :
205
293
path : ${{ steps.go.outputs.cache }}
206
294
key : ${{ runner.os }}-build-publish-artifacts-${{ hashFiles('**/go.sum') }}
207
295
restore-keys : ${{ runner.os }}-build-publish-artifacts-
208
296
209
297
- name : Cache Go Dependencies
210
- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
298
+ uses : actions/cache@v4
211
299
with :
212
300
path : .work/pkg
213
301
key : ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
@@ -222,24 +310,13 @@ jobs:
222
310
# We're using docker buildx, which doesn't actually load the images it
223
311
# builds by default. Specifying --load does so.
224
312
BUILD_ARGS : " --load"
225
-
226
- - name : Publish Artifacts to GitHub
227
- uses : actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4
313
+
314
+ - name : Upload Artifacts to GitHub
315
+ uses : actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
228
316
with :
229
317
name : output
230
318
path : _output/**
231
319
232
- - name : Login to Upbound
233
- uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
234
- if : env.XPKG_ACCESS_ID != ''
235
- with :
236
- registry : xpkg.upbound.io
237
- username : ${{ secrets.XPKG_ACCESS_ID }}
238
- password : ${{ secrets.XPKG_TOKEN }}
239
-
240
320
- name : Publish Artifacts
321
+ if : env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != ''
241
322
run : make publish BRANCH_NAME=${GITHUB_REF##*/}
242
- if : env.XPKG_ACCESS_ID != ''
243
- env :
244
- UPBOUND_MARKETPLACE_PUSH_ROBOT_USR : ${{ secrets.XPKG_ACCESS_ID }}
245
- UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW : ${{ secrets.XPKG_TOKEN }}
0 commit comments