@@ -31,20 +31,33 @@ jobs:
3131 outputs :
3232 go_path : ${{ steps.vars.outputs.go_path }}
3333 min_k8s_version : ${{ steps.vars.outputs.min_k8s_version }}
34+ k8s_latest : ${{ steps.vars.outputs.k8s_latest }}
35+ helm_changes : ${{ steps.filter.outputs.charts }}
3436 steps :
3537 - name : Checkout Repository
3638 uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
39+ with :
40+ fetch-depth : 0
3741
3842 - name : Setup Golang Environment
3943 uses : actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
4044 with :
4145 go-version : stable
4246
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+
4355 - name : Output Variables
4456 id : vars
4557 run : |
4658 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
4861
4962 - name : Check if go.mod and go.sum are up to date
5063 run : go mod tidy && git diff --exit-code -- go.mod go.sum
@@ -211,7 +224,7 @@ jobs:
211224 fail-fast : false
212225 matrix :
213226 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 }} "]
215228 uses : ./.github/workflows/functional.yml
216229 with :
217230 image : ${{ matrix.image }}
@@ -226,7 +239,7 @@ jobs:
226239 fail-fast : false
227240 matrix :
228241 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 }} "]
230243 enable-experimental : [true, false]
231244 uses : ./.github/workflows/conformance.yml
232245 with :
@@ -238,96 +251,18 @@ jobs:
238251
239252 helm-tests :
240253 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 kustomize config/crd/gateway-api/standard | kubectl apply -f -
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' }}
331266
332267 publish-helm :
333268 name : Package and Publish Helm Chart
0 commit comments