Skip to content

Commit 096775b

Browse files
authored
Merge branch 'main' into docs/product-telemetry
2 parents 2b3de20 + b6cb677 commit 096775b

File tree

23 files changed

+162
-141
lines changed

23 files changed

+162
-141
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ jobs:
9494
tags: |
9595
type=semver,pattern={{version}}
9696
type=edge
97+
type=schedule
9798
type=ref,event=pr
9899
type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
99100
type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }}

.github/workflows/ci.yml

Lines changed: 60 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Continuous Integration
1+
name: CI
22

33
on:
44
push:
@@ -8,6 +8,8 @@ on:
88
tags:
99
- "v[0-9]+.[0-9]+.[0-9]+*"
1010
pull_request:
11+
schedule:
12+
- cron: "0 4 * * *" # run every day at 4am UTC
1113

1214
defaults:
1315
run:
@@ -26,6 +28,7 @@ jobs:
2628
runs-on: ubuntu-22.04
2729
outputs:
2830
go_path: ${{ steps.vars.outputs.go_path }}
31+
min_k8s_version: ${{ steps.vars.outputs.min_k8s_version }}
2932
steps:
3033
- name: Checkout Repository
3134
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
@@ -37,7 +40,9 @@ jobs:
3740

3841
- name: Output Variables
3942
id: vars
40-
run: echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT
43+
run: |
44+
echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT
45+
echo "min_k8s_version=1.23.17" >> $GITHUB_OUTPUT
4146
4247
- name: Check if go.mod and go.sum are up to date
4348
run: go mod tidy && git diff --exit-code -- go.mod go.sum
@@ -151,7 +156,7 @@ jobs:
151156
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}
152157
AZURE_BUCKET_NAME: ${{ secrets.AZURE_BUCKET_NAME }}
153158
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_COMMUNITY }}
154-
TELEMETRY_ENDPOINT: "" # disables sending telemetry
159+
TELEMETRY_ENDPOINT: oss.edge.df.f5.com:443
155160
TELEMETRY_ENDPOINT_INSECURE: "false"
156161

157162
- name: Cache Artifacts
@@ -160,10 +165,61 @@ jobs:
160165
path: ${{ github.workspace }}/dist
161166
key: nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }}
162167

168+
build:
169+
name: Build Image
170+
needs: [vars, binary]
171+
strategy:
172+
fail-fast: false
173+
matrix:
174+
image: [ngf, nginx, plus]
175+
platforms: ["linux/arm64, linux/amd64"]
176+
uses: ./.github/workflows/build.yml
177+
with:
178+
image: ${{ matrix.image }}
179+
platforms: ${{ matrix.platforms }}
180+
permissions:
181+
contents: read # for docker/build-push-action to read repo content
182+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
183+
packages: write # for docker/build-push-action to push to GHCR
184+
id-token: write # for docker/login to login to NGINX registry
185+
secrets: inherit
186+
187+
functional-tests:
188+
name: Functional tests
189+
needs: [vars, build]
190+
strategy:
191+
fail-fast: false
192+
matrix:
193+
image: [nginx, plus]
194+
k8s-version: ["${{ needs.vars.outputs.min_k8s_version }}", "latest"]
195+
uses: ./.github/workflows/functional.yml
196+
with:
197+
image: ${{ matrix.image }}
198+
k8s-version: ${{ matrix.k8s-version }}
199+
permissions:
200+
contents: read
201+
202+
conformance-tests:
203+
name: Conformance tests
204+
needs: [vars, build]
205+
strategy:
206+
fail-fast: false
207+
matrix:
208+
image: [nginx, plus]
209+
k8s-version: ["${{ needs.vars.outputs.min_k8s_version }}", "latest"]
210+
enable-experimental: [true, false]
211+
uses: ./.github/workflows/conformance.yml
212+
with:
213+
image: ${{ matrix.image }}
214+
k8s-version: ${{ matrix.k8s-version }}
215+
enable-experimental: ${{ matrix.enable-experimental }}
216+
permissions:
217+
contents: write
218+
163219
helm-tests:
164220
name: Helm Tests
165221
runs-on: ubuntu-22.04
166-
needs: [vars, binary]
222+
needs: [vars, build]
167223
steps:
168224
- name: Checkout Repository
169225
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
@@ -210,7 +266,6 @@ jobs:
210266
target: goreleaser
211267
load: true
212268
cache-from: type=gha,scope=ngf
213-
cache-to: type=gha,scope=ngf,mode=max
214269
pull: true
215270

216271
- name: Build NGINX Docker Image
@@ -221,7 +276,6 @@ jobs:
221276
context: "."
222277
load: true
223278
cache-from: type=gha,scope=nginx
224-
cache-to: type=gha,scope=nginx,mode=max
225279
pull: true
226280
build-args: |
227281
NJS_DIR=internal/mode/static/nginx/modules/src
@@ -254,25 +308,6 @@ jobs:
254308
-n nginx-gateway
255309
working-directory: ${{ github.workspace }}/deploy/helm-chart
256310

257-
build:
258-
name: Build Image
259-
needs: [vars, binary]
260-
strategy:
261-
fail-fast: false
262-
matrix:
263-
image: [ngf, nginx, plus]
264-
platforms: ["linux/arm64, linux/amd64"]
265-
uses: ./.github/workflows/build.yml
266-
with:
267-
image: ${{ matrix.image }}
268-
platforms: ${{ matrix.platforms }}
269-
permissions:
270-
contents: read # for docker/build-push-action to read repo content
271-
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
272-
packages: write # for docker/build-push-action to push to GHCR
273-
id-token: write # for docker/login to login to NGINX registry
274-
secrets: inherit
275-
276311
publish-helm:
277312
name: Package and Publish Helm Chart
278313
runs-on: ubuntu-22.04

.github/workflows/conformance.yml

Lines changed: 28 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,40 @@
11
name: Conformance Testing
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- release-*
8-
tags:
9-
- "v[0-9]+.[0-9]+.[0-9]+*"
10-
pull_request:
11-
schedule:
12-
- cron: "0 4 * * *" # run every day at 4am UTC
4+
workflow_call:
5+
inputs:
6+
image:
7+
required: true
8+
type: string
9+
k8s-version:
10+
required: true
11+
type: string
12+
enable-experimental:
13+
required: true
14+
type: boolean
1315

1416
defaults:
1517
run:
1618
shell: bash
1719

18-
concurrency:
19-
group: ${{ github.ref_name }}-conformance
20-
cancel-in-progress: true
21-
2220
permissions:
2321
contents: read
2422

2523
jobs:
2624
conformance-tests:
27-
name: Gateway Conformance Tests
25+
name: Run Tests
2826
runs-on: ubuntu-22.04
29-
strategy:
30-
matrix:
31-
k8s-version: ["1.23.17", "latest"]
32-
nginx-image: [nginx, nginx-plus]
33-
enable-experimental: [true, false]
3427
permissions:
3528
contents: write # needed for uploading release artifacts
3629
steps:
3730
- name: Checkout Repository
3831
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
3932

40-
- name: Setup Golang Environment
41-
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
33+
- name: Fetch Cached Artifacts
34+
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
4235
with:
43-
go-version: stable
44-
45-
- name: Set GOPATH
46-
run: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
36+
path: ${{ github.workspace }}/dist
37+
key: nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }}
4738

4839
- name: Docker Buildx
4940
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0
@@ -57,6 +48,7 @@ jobs:
5748
tags: |
5849
type=semver,pattern={{version}}
5950
type=edge
51+
type=schedule
6052
type=ref,event=pr
6153
type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
6254
@@ -65,29 +57,21 @@ jobs:
6557
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
6658
with:
6759
images: |
68-
name=ghcr.io/nginxinc/nginx-gateway-fabric/${{ matrix.nginx-image }}
60+
name=ghcr.io/nginxinc/nginx-gateway-fabric/${{ inputs.image == 'plus' && 'nginx-plus' || inputs.image }}
6961
tags: |
7062
type=semver,pattern={{version}}
7163
type=edge
64+
type=schedule
7265
type=ref,event=pr
7366
type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
7467
7568
- name: Prepare NGF files
7669
run: |
7770
ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric
7871
ngf_tag=${{ steps.ngf-meta.outputs.version }}
79-
make update-ngf-manifest${{ matrix.nginx-image == 'nginx-plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
72+
make update-ngf-manifest${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
8073
working-directory: ./conformance
8174

82-
- name: Build binary
83-
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
84-
with:
85-
version: latest
86-
args: build --snapshot --clean
87-
env:
88-
TELEMETRY_ENDPOINT: "" # disables sending telemetry
89-
TELEMETRY_ENDPOINT_INSECURE: "false"
90-
9175
- name: Build NGF Docker Image
9276
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
9377
with:
@@ -97,18 +81,16 @@ jobs:
9781
target: goreleaser
9882
load: true
9983
cache-from: type=gha,scope=ngf
100-
cache-to: type=gha,scope=ngf,mode=max
10184
pull: true
10285

10386
- name: Build NGINX Docker Image
10487
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
10588
with:
106-
file: build/Dockerfile${{ matrix.nginx-image == 'nginx' && '.nginx' || '' }}${{ matrix.nginx-image == 'nginx-plus' && '.nginxplus' || ''}}
89+
file: build/Dockerfile${{ inputs.image == 'nginx' && '.nginx' || '' }}${{ inputs.image == 'plus' && '.nginxplus' || ''}}
10790
tags: ${{ steps.nginx-meta.outputs.tags }}
10891
context: "."
10992
load: true
110-
cache-from: type=gha,scope=${{ matrix.nginx-image }}
111-
cache-to: type=gha,scope=${{ matrix.nginx-image }},mode=max
93+
cache-from: type=gha,scope=${{ inputs.image }}
11294
pull: true
11395
build-args: |
11496
NJS_DIR=internal/mode/static/nginx/modules/src
@@ -134,26 +116,19 @@ jobs:
134116
- name: Deploy Kubernetes
135117
id: k8s
136118
run: |
137-
k8s_version=${{ matrix.k8s-version }}
138-
make create-kind-cluster KIND_KUBE_CONFIG=${{ github.workspace }}/kube-${{ github.run_id }} ${{ ! contains(matrix.k8s-version, 'latest') && 'KIND_IMAGE=kindest/node:v${k8s_version}' || '' }}
119+
k8s_version=${{ inputs.k8s-version }}
120+
make create-kind-cluster KIND_KUBE_CONFIG=${{ github.workspace }}/kube-${{ github.run_id }} ${{ ! contains(inputs.k8s-version, 'latest') && 'KIND_IMAGE=kindest/node:v${k8s_version}' || '' }}
139121
echo "KUBECONFIG=${{ github.workspace }}/kube-${{ github.run_id }}" >> "$GITHUB_ENV"
140122
working-directory: ./conformance
141123

142-
- name: Wait for release to exist
143-
if: startsWith(github.ref, 'refs/tags/')
144-
run: |
145-
REF=${{ github.ref_name }}
146-
until docker pull ghcr.io/nginxinc/nginx-gateway-fabric:${REF#v}; do sleep 5; done
147-
until docker pull ghcr.io/nginxinc/nginx-gateway-fabric/nginx:${REF#v}; do sleep 5; done
148-
149124
- name: Setup conformance tests
150125
run: |
151126
ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric
152127
ngf_tag=${{ steps.ngf-meta.outputs.version }}
153128
if [ ${{ github.event_name }} == "schedule" ]; then export GW_API_VERSION=main; fi
154-
if [ ${{ startsWith(matrix.k8s-version, '1.23') || startsWith(matrix.k8s-version, '1.24') }} == "true" ]; then export INSTALL_WEBHOOK=true; fi
155-
if [ ${{ matrix.enable-experimental }} == "true" ]; then export ENABLE_EXPERIMENTAL=true; fi
156-
make install-ngf-local-no-build${{ matrix.nginx-image == 'nginx-plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
129+
if [ ${{ startsWith(inputs.k8s-version, '1.23') || startsWith(inputs.k8s-version, '1.24') }} == "true" ]; then export INSTALL_WEBHOOK=true; fi
130+
if [ ${{ inputs.enable-experimental }} == "true" ]; then export ENABLE_EXPERIMENTAL=true; fi
131+
make install-ngf-local-no-build${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
157132
working-directory: ./conformance
158133

159134
- name: Run conformance tests
@@ -165,7 +140,7 @@ jobs:
165140
working-directory: ./conformance
166141

167142
- name: Upload profile to release
168-
if: ${{ matrix.k8s-version == 'latest' && startsWith(github.ref, 'refs/tags/') }}
143+
if: ${{ inputs.k8s-version == 'latest' && startsWith(github.ref, 'refs/tags/') }}
169144
env:
170145
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
171146
run: gh release upload ${{ github.ref_name }} conformance-profile.yaml

0 commit comments

Comments
 (0)