1
1
name : Conformance Testing
2
2
3
3
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
13
15
14
16
defaults :
15
17
run :
16
18
shell : bash
17
19
18
- concurrency :
19
- group : ${{ github.ref_name }}-conformance
20
- cancel-in-progress : true
21
-
22
20
permissions :
23
21
contents : read
24
22
25
23
jobs :
26
24
conformance-tests :
27
- name : Gateway Conformance Tests
25
+ name : Run Tests
28
26
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]
34
27
permissions :
35
28
contents : write # needed for uploading release artifacts
36
29
steps :
37
30
- name : Checkout Repository
38
31
uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
39
32
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
42
35
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 }}
47
38
48
39
- name : Docker Buildx
49
40
uses : docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0
65
56
uses : docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
66
57
with :
67
58
images : |
68
- name=ghcr.io/nginxinc/nginx-gateway-fabric/${{ matrix. nginx-image }}
59
+ name=ghcr.io/nginxinc/nginx-gateway-fabric/${{ inputs.image == 'plus' && ' nginx-plus' || inputs. image }}
69
60
tags : |
70
61
type=semver,pattern={{version}}
71
62
type=edge
76
67
run : |
77
68
ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric
78
69
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}
70
+ make update-ngf-manifest${{ inputs. image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
80
71
working-directory : ./conformance
81
72
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
-
91
73
- name : Build NGF Docker Image
92
74
uses : docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
93
75
with :
@@ -97,18 +79,16 @@ jobs:
97
79
target : goreleaser
98
80
load : true
99
81
cache-from : type=gha,scope=ngf
100
- cache-to : type=gha,scope=ngf,mode=max
101
82
pull : true
102
83
103
84
- name : Build NGINX Docker Image
104
85
uses : docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
105
86
with :
106
- file : build/Dockerfile${{ matrix.nginx- image == 'nginx' && '.nginx' || '' }}${{ matrix.nginx- image == 'nginx- plus' && '.nginxplus' || ''}}
87
+ file : build/Dockerfile${{ inputs. image == 'nginx' && '.nginx' || '' }}${{ inputs. image == 'plus' && '.nginxplus' || ''}}
107
88
tags : ${{ steps.nginx-meta.outputs.tags }}
108
89
context : " ."
109
90
load : true
110
- cache-from : type=gha,scope=${{ matrix.nginx-image }}
111
- cache-to : type=gha,scope=${{ matrix.nginx-image }},mode=max
91
+ cache-from : type=gha,scope=${{ inputs.image }}
112
92
pull : true
113
93
build-args : |
114
94
NJS_DIR=internal/mode/static/nginx/modules/src
@@ -134,8 +114,8 @@ jobs:
134
114
- name : Deploy Kubernetes
135
115
id : k8s
136
116
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}' || '' }}
117
+ k8s_version=${{ inputs .k8s-version }}
118
+ 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}' || '' }}
139
119
echo "KUBECONFIG=${{ github.workspace }}/kube-${{ github.run_id }}" >> "$GITHUB_ENV"
140
120
working-directory : ./conformance
141
121
@@ -151,9 +131,9 @@ jobs:
151
131
ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric
152
132
ngf_tag=${{ steps.ngf-meta.outputs.version }}
153
133
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}
134
+ if [ ${{ startsWith(inputs .k8s-version, '1.23') || startsWith(inputs .k8s-version, '1.24') }} == "true" ]; then export INSTALL_WEBHOOK=true; fi
135
+ if [ ${{ inputs .enable-experimental }} == "true" ]; then export ENABLE_EXPERIMENTAL=true; fi
136
+ make install-ngf-local-no-build${{ inputs. image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
157
137
working-directory : ./conformance
158
138
159
139
- name : Run conformance tests
@@ -165,7 +145,7 @@ jobs:
165
145
working-directory : ./conformance
166
146
167
147
- name : Upload profile to release
168
- if : ${{ matrix .k8s-version == 'latest' && startsWith(github.ref, 'refs/tags/') }}
148
+ if : ${{ inputs .k8s-version == 'latest' && startsWith(github.ref, 'refs/tags/') }}
169
149
env :
170
150
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
171
151
run : gh release upload ${{ github.ref_name }} conformance-profile.yaml
0 commit comments