@@ -31,20 +31,33 @@ jobs:
31
31
outputs :
32
32
go_path : ${{ steps.vars.outputs.go_path }}
33
33
min_k8s_version : ${{ steps.vars.outputs.min_k8s_version }}
34
+ k8s_latest : ${{ steps.vars.outputs.k8s_latest }}
35
+ helm_changes : ${{ steps.filter.outputs.charts }}
34
36
steps :
35
37
- name : Checkout Repository
36
38
uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
39
+ with :
40
+ fetch-depth : 0
37
41
38
42
- name : Setup Golang Environment
39
43
uses : actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
40
44
with :
41
45
go-version : stable
42
46
47
+ - name : Check for changes
48
+ uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
49
+ id : filter
50
+ with :
51
+ filters : |
52
+ charts:
53
+ - charts/nginx-gateway-fabric/**/*
54
+
43
55
- name : Output Variables
44
56
id : vars
45
57
run : |
46
58
echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT
47
- echo "min_k8s_version=1.25.16" >> $GITHUB_OUTPUT
59
+ echo "min_k8s_version=v1.25.16" >> $GITHUB_OUTPUT
60
+ echo "k8s_latest=$(grep -m1 'FROM kindest/node' <tests/Dockerfile | awk -F'[:]' '{print $2}')" >> $GITHUB_OUTPUT
48
61
49
62
- name : Check if go.mod and go.sum are up to date
50
63
run : go mod tidy && git diff --exit-code -- go.mod go.sum
@@ -131,7 +144,7 @@ jobs:
131
144
go-version : stable
132
145
133
146
- name : Create/Update Draft
134
- uses : lucacome/draft-release@e076259ceb036bc5f2c2a76559784c12cf8d2e74 # v1.0.4
147
+ uses : lucacome/draft-release@8a63d32c79a171ae6048e614a8988f0ac3ed56d4 # v1.1.0
135
148
with :
136
149
minor-label : " enhancement"
137
150
major-label : " change"
@@ -211,7 +224,7 @@ jobs:
211
224
fail-fast : false
212
225
matrix :
213
226
image : [nginx, plus]
214
- k8s-version : ["${{ needs.vars.outputs.min_k8s_version }}", "latest "]
227
+ k8s-version : ["${{ needs.vars.outputs.min_k8s_version }}", "${{ needs.vars.outputs.k8s_latest }} "]
215
228
uses : ./.github/workflows/functional.yml
216
229
with :
217
230
image : ${{ matrix.image }}
@@ -226,7 +239,7 @@ jobs:
226
239
fail-fast : false
227
240
matrix :
228
241
image : [nginx, plus]
229
- k8s-version : ["${{ needs.vars.outputs.min_k8s_version }}", "latest "]
242
+ k8s-version : ["${{ needs.vars.outputs.min_k8s_version }}", "${{ needs.vars.outputs.k8s_latest }} "]
230
243
enable-experimental : [true, false]
231
244
uses : ./.github/workflows/conformance.yml
232
245
with :
@@ -238,96 +251,18 @@ jobs:
238
251
239
252
helm-tests :
240
253
name : Helm Tests
241
- runs-on : ubuntu-22.04
242
- needs : [vars, build-oss]
243
- steps :
244
- - name : Checkout Repository
245
- uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
246
-
247
- - name : Fetch Cached Artifacts
248
- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
249
- with :
250
- path : ${{ github.workspace }}/dist
251
- key : nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }}
252
-
253
- - name : Docker Buildx
254
- uses : docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
255
-
256
- - name : NGF Docker meta
257
- id : ngf-meta
258
- uses : docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
259
- with :
260
- images : |
261
- name=ghcr.io/nginxinc/nginx-gateway-fabric
262
- tags : |
263
- type=semver,pattern={{version}}
264
- type=edge
265
- type=ref,event=pr
266
- type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
267
-
268
- - name : NGINX Docker meta
269
- id : nginx-meta
270
- uses : docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
271
- with :
272
- images : |
273
- name=ghcr.io/nginxinc/nginx-gateway-fabric/nginx
274
- tags : |
275
- type=semver,pattern={{version}}
276
- type=edge
277
- type=ref,event=pr
278
- type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
279
-
280
- - name : Build NGF Docker Image
281
- uses : docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
282
- with :
283
- file : build/Dockerfile
284
- tags : ${{ steps.ngf-meta.outputs.tags }}
285
- context : " ."
286
- target : goreleaser
287
- load : true
288
- cache-from : type=gha,scope=ngf
289
- pull : true
290
-
291
- - name : Build NGINX Docker Image
292
- uses : docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
293
- with :
294
- file : build/Dockerfile.nginx
295
- tags : ${{ steps.nginx-meta.outputs.tags }}
296
- context : " ."
297
- load : true
298
- cache-from : type=gha,scope=nginx
299
- pull : true
300
- build-args : |
301
- NJS_DIR=internal/mode/static/nginx/modules/src
302
- NGINX_CONF_DIR=internal/mode/static/nginx/conf
303
- BUILD_AGENT=gha
304
-
305
- - name : Deploy Kubernetes
306
- id : k8s
307
- run : |
308
- kube_config=${{ github.workspace }}/kube-${{ github.run_id }}-helm
309
- make create-kind-cluster KIND_KUBE_CONFIG=${kube_config}
310
- echo "KUBECONFIG=${kube_config}" >> "$GITHUB_ENV"
311
- kind load docker-image ghcr.io/nginxinc/nginx-gateway-fabric:${{ steps.ngf-meta.outputs.version }} ghcr.io/nginxinc/nginx-gateway-fabric/nginx:${{ steps.nginx-meta.outputs.version }}
312
- kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
313
-
314
- - name : Install Chart
315
- run : >
316
- helm install
317
- helm-$(echo ${{ steps.ngf-meta.outputs.version }} | tr '.' '-')
318
- .
319
- --wait
320
- --create-namespace
321
- --set nginxGateway.image.repository=ghcr.io/nginxinc/nginx-gateway-fabric
322
- --set nginxGateway.image.tag=${{ steps.ngf-meta.outputs.version }}
323
- --set nginxGateway.image.pullPolicy=Never
324
- --set nginxGateway.productTelemetry.enable=false
325
- --set nginx.image.repository=ghcr.io/nginxinc/nginx-gateway-fabric/nginx
326
- --set nginx.image.tag=${{ steps.nginx-meta.outputs.version }}
327
- --set nginx.image.pullPolicy=Never
328
- --set service.type=NodePort
329
- -n nginx-gateway
330
- working-directory : ${{ github.workspace }}/charts/nginx-gateway-fabric
254
+ needs : [vars, build-oss, build-plus]
255
+ strategy :
256
+ fail-fast : false
257
+ matrix :
258
+ image : [nginx, plus]
259
+ k8s-version : ["${{ needs.vars.outputs.min_k8s_version }}", "${{ needs.vars.outputs.k8s_latest }}"]
260
+ uses : ./.github/workflows/helm.yml
261
+ with :
262
+ image : ${{ matrix.image }}
263
+ k8s-version : ${{ matrix.k8s-version }}
264
+ secrets : inherit
265
+ if : ${{ needs.vars.outputs.helm_changes == 'true' || github.event_name == 'schedule' }}
331
266
332
267
publish-helm :
333
268
name : Package and Publish Helm Chart
@@ -342,7 +277,7 @@ jobs:
342
277
uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
343
278
344
279
- name : Login to GitHub Container Registry
345
- uses : docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1 .0
280
+ uses : docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2 .0
346
281
with :
347
282
registry : ghcr.io
348
283
username : ${{ github.repository_owner }}
0 commit comments