@@ -144,10 +144,88 @@ jobs:
144
144
path : ${{ github.workspace }}/dist
145
145
key : nginx-kubernetes-gateway-${{ github.run_id }}-${{ github.run_number }}
146
146
147
+ conformance-tests :
148
+ name : Gateway Conformance Tests
149
+ runs-on : ubuntu-22.04
150
+ needs : [vars, binary]
151
+ steps :
152
+ - name : Checkout Repository
153
+ uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
154
+
155
+ - name : Fetch Cached Artifacts
156
+ uses : actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
157
+ with :
158
+ path : ${{ github.workspace }}/dist
159
+ key : nginx-kubernetes-gateway-${{ github.run_id }}-${{ github.run_number }}
160
+
161
+ - name : Docker Buildx
162
+ uses : docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # v2.7.0
163
+
164
+ - name : Docker meta
165
+ id : meta
166
+ uses : docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4.6.0
167
+ with :
168
+ images : |
169
+ name=ghcr.io/nginxinc/nginx-kubernetes-gateway
170
+ tags : |
171
+ type=semver,pattern={{version}}
172
+ type=edge
173
+ type=ref,event=pr
174
+ type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
175
+
176
+ - name : Prepare NKG files
177
+ run : |
178
+ nkg_prefix=$(echo ${{ steps.meta.outputs.tags }} | cut -d ":" -f 1)
179
+ nkg_tag=$(echo ${{ steps.meta.outputs.tags }} | cut -d ":" -f 2)
180
+ yq -i "with(.spec.template.spec.containers[0]; .image = \"${nkg_prefix}:${nkg_tag}\" | .imagePullPolicy = \"Never\")" deploy/manifests/deployment.yaml
181
+
182
+ - name : Build Docker Image
183
+ uses : docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
184
+ with :
185
+ file : build/Dockerfile
186
+ tags : ${{ steps.meta.outputs.tags }}
187
+ context : " ."
188
+ target : goreleaser
189
+ load : true
190
+ cache-from : type=gha
191
+ cache-to : type=gha,mode=max
192
+ pull : true
193
+
194
+ - name : Build Test Docker Image
195
+ uses : docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
196
+ with :
197
+ file : conformance/tests/Dockerfile
198
+ tags : conformance-test-runner:${{ github.sha }}
199
+ context : " ."
200
+ load : true
201
+ cache-from : type=gha
202
+ cache-to : type=gha,mode=max
203
+ pull : true
204
+
205
+ - name : Deploy Kubernetes
206
+ id : k8s
207
+ run : |
208
+ kind create cluster --image kindest/node:v1.27.1 --kubeconfig kube-${{ github.run_id }}
209
+ echo "KUBECONFIG=kube-${{ github.run_id }}" >> "$GITHUB_ENV"
210
+ working-directory : ./conformance
211
+
212
+ - name : Setup conformance tests
213
+ run : |
214
+ nkg_prefix=$(echo ${{ steps.meta.outputs.tags }} | cut -d ":" -f 1)
215
+ nkg_tag=$(echo ${{ steps.meta.outputs.tags }} | cut -d ":" -f 2)
216
+ make install-nkg-local-build NKG_PREFIX=${nkg_prefix} NKG_TAG=${nkg_tag} BUILD_NKG=false
217
+ working-directory : ./conformance
218
+
219
+ - name : Run conformance tests
220
+ run : |
221
+ make run-conformance-tests TAG=${{ github.sha }}
222
+ working-directory : ./conformance
223
+ continue-on-error : true
224
+
147
225
build :
148
226
name : Build Image
149
227
runs-on : ubuntu-22.04
150
- needs : [vars, binary]
228
+ needs : [vars, binary, conformance-tests ]
151
229
steps :
152
230
- name : Checkout Repository
153
231
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
0 commit comments