2828 runs-on : ubuntu-latest
2929 outputs :
3030 release_tag : ${{ steps.vars.outputs.release_tag }}
31+ checkout_ref : ${{ steps.vars.outputs.checkout_ref }}
3132 control_image : ${{ steps.vars.outputs.control_image }}
3233 control_image_name : ${{ steps.vars.outputs.control_image_name }}
3334
@@ -47,21 +48,26 @@ jobs:
4748 fi
4849
4950 owner_lc="${GITHUB_REPOSITORY_OWNER,,}"
51+ checkout_ref="refs/tags/${release_tag}"
5052 control_image_name="ghcr.io/${owner_lc}/nantian-controlplane"
5153 control_image="${control_image_name}:${release_tag}"
5254
5355 {
5456 echo "release_tag=${release_tag}"
57+ echo "checkout_ref=${checkout_ref}"
5558 echo "control_image=${control_image}"
5659 echo "control_image_name=${control_image_name}"
5760 } >>"${GITHUB_OUTPUT}"
5861
5962 security-scans :
6063 name : Security Scans
64+ needs : metadata
6165 permissions :
6266 contents : read
6367 security-events : read
6468 uses : ./.github/workflows/security-scans.yml
69+ with :
70+ checkout_ref : ${{ needs.metadata.outputs.checkout_ref }}
6571
6672 controlplane :
6773 name : Controlplane Tests
7278 steps :
7379 - name : Checkout
7480 uses : actions/checkout@v6
81+ with :
82+ ref : ${{ needs.metadata.outputs.checkout_ref }}
7583
7684 - name : Set up Go
7785 uses : actions/setup-go@v6
8088 cache-dependency-path : go.sum
8189
8290 - name : Run Go unit tests
83- working-directory : controlplane
84- run : go test ./...
91+ run : go test -count=1 -timeout 5m ./...
8592
8693 kind-smoke :
8794 name : Kind Validation
@@ -90,11 +97,20 @@ jobs:
9097 - metadata
9198 - controlplane
9299 timeout-minutes : 90
100+ env :
101+ CLUSTER_NAME : release-validation
102+ GATEWAY_API_VERSION : v1.5.1
103+ CONTROLPLANE_IMAGE : ${{ needs.metadata.outputs.control_image }}
104+ DATAPLANE_IMAGE : ghcr.io/nantian-gw/dataplane:latest
105+ DASHBOARD_IMAGE : ghcr.io/nantian-gw/dashboard:latest
106+ CONFORMANCE_EXPERIMENTAL : " true"
107+ ALL_FEATURES : " true"
93108
94109 steps :
95110 - name : Checkout
96111 uses : actions/checkout@v6
97112 with :
113+ ref : ${{ needs.metadata.outputs.checkout_ref }}
98114 fetch-depth : 0
99115
100116 - name : Set up Go
@@ -103,82 +119,73 @@ jobs:
103119 go-version-file : go.mod
104120 cache-dependency-path : go.sum
105121
106- - name : Install release validation dependencies
122+ - name : Install Kind tooling
123+ run : scripts/ci/install-kind-tools.sh
124+
125+ - name : Create kind cluster
126+ run : scripts/ci/create-kind-cluster.sh
127+
128+ - name : Install Gateway API CRDs
129+ run : scripts/ci/install-gateway-api-crds.sh
130+
131+ - name : Build current control-plane image
132+ run : scripts/ci/build-controlplane-image.sh
133+
134+ - name : Load images into kind
135+ run : scripts/ci/load-kind-images.sh
136+
137+ - name : Deploy Nantian Gateway
138+ run : scripts/ci/deploy-kind-conformance.sh
139+
140+ - name : Record image versions
107141 run : |
108- sudo apt-get update
109- sudo apt-get install -y --no-install-recommends protobuf-compiler libprotobuf-dev jq socat
110- go install sigs.k8s.io/kind@v0.27.0
111- sudo curl -fsSL "https://dl.k8s.io/release/v1.32.2/bin/linux/amd64/kubectl" -o /usr/local/bin/kubectl
112- sudo chmod +x /usr/local/bin/kubectl
113- echo "$(go env GOPATH)/bin" >>"${GITHUB_PATH}"
114-
115- - name : Run Kind smoke test with release tag
116- env :
117- IMAGE_TAG : ${{ needs.metadata.outputs.release_tag }}
118- run : ./tests/e2e/run-kind.sh
142+ echo "=== Images under test ==="
143+ kubectl get pods -n nantian-gw -o json | jq -r '.items[] | .spec.containers[] | " \(.name): \(.image)"'
144+ echo "=== Image digests ==="
145+ kubectl get pods -n nantian-gw -o json | jq -r '.items[] | .status.containerStatuses[] | " \(.name): \(.imageID)"'
146+
147+ - name : Run smoke test
148+ run : CLUSTER_NAME="$CLUSTER_NAME" ./test/e2e/smoke/run.sh --no-cleanup
119149
120150 - name : Run full Gateway API conformance
121151 id : conformance
122152 env :
123153 RELEASE_TAG : ${{ needs.metadata.outputs.release_tag }}
124- REPORT_PATH : ${{ github.workspace }}/dist/conformance/report.yaml
125- LOG_PATH : ${{ github.workspace }}/dist/conformance/run.log
126154 run : |
127155 mkdir -p dist/conformance
156+ report_path="${GITHUB_WORKSPACE}/dist/conformance/report.yaml"
128157 set +e
129- ALL_FEATURES=true \
130- IMPLEMENTATION_VERSION="${RELEASE_TAG}" \
131- REPORT_OUTPUT="${REPORT_PATH}" \
132- ./tests/conformance/run.sh 2>&1 | tee "${LOG_PATH}"
158+ go test -tags=conformance -count=1 -v -timeout 30m ./conformance/ \
159+ -args \
160+ -gateway-class nantian-gw \
161+ -report-output "$report_path" \
162+ -organization "Nantian Gateway" \
163+ -project "Nantian Gateway" \
164+ -url "https://github.com/nantian-gw/gateway" \
165+ -version "${RELEASE_TAG}" \
166+ -contact "https://github.com/nantian-gw/gateway/issues" 2>&1 \
167+ | tee dist/conformance/run.log
133168 status=${PIPESTATUS[0]}
134169 echo "exit_code=${status}" >>"${GITHUB_OUTPUT}"
135170 exit "${status}"
136171
137- - name : Archive conformance report into repository layout
138- if : always()
139- env :
140- RELEASE_TAG : ${{ needs.metadata.outputs.release_tag }}
141- SOURCE_COMMAND : ALL_FEATURES=true IMPLEMENTATION_VERSION=${{ needs.metadata.outputs.release_tag }} REPORT_OUTPUT=${{ github.workspace }}/dist/conformance/report.yaml ./tests/conformance/run.sh
142- SOURCE_RUN_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
143- run : |
144- if [[ ! -f dist/conformance/report.yaml ]]; then
145- echo "no report produced; skipping archival"
146- exit 0
147- fi
148-
149- if [[ "${{ steps.conformance.outputs.exit_code }}" == "0" ]]; then
150- export RESULT_STATUS=passed
151- else
152- export RESULT_STATUS=failed
153- fi
154- export REPORT_SCOPE=releases
155-
156- scripts/archive-conformance-report.sh \
157- "${RELEASE_TAG}" \
158- "${GITHUB_WORKSPACE}/dist/conformance/report.yaml" \
159- "${GITHUB_WORKSPACE}/dist/conformance/run.log"
160-
161- cp "reports/conformance/releases/${RELEASE_TAG}/metadata.yaml" "dist/conformance/metadata.yaml"
172+ - name : Collect diagnostics on failure
173+ if : failure()
174+ run : ARTIFACT_DIR=tmp/conformance-diagnostics scripts/ci/collect-kind-diagnostics.sh
162175
163- - name : Upload conformance artifact
176+ - name : Upload conformance artifacts
164177 if : always()
165178 uses : actions/upload-artifact@v7
166179 with :
167180 name : conformance-${{ needs.metadata.outputs.release_tag }}
168- path : dist/conformance/
181+ path : |
182+ dist/conformance/
183+ tmp/conformance-diagnostics/
169184 if-no-files-found : warn
170185
171- - name : Publish conformance reports branch
186+ - name : Cleanup
172187 if : always()
173- env :
174- COMMIT_MESSAGE : " conformance: archive ${{ needs.metadata.outputs.release_tag }}"
175- run : |
176- if [[ ! -f reports/conformance/latest/report.yaml ]]; then
177- echo "no archived report available; skipping branch publish"
178- exit 0
179- fi
180-
181- scripts/publish-conformance-reports.sh conformance-reports
188+ run : command -v kind >/dev/null 2>&1 && kind delete cluster --name "$CLUSTER_NAME" || true
182189
183190 publish :
184191 name : Publish Release Images
@@ -194,6 +201,8 @@ jobs:
194201 steps :
195202 - name : Checkout
196203 uses : actions/checkout@v6
204+ with :
205+ ref : ${{ needs.metadata.outputs.checkout_ref }}
197206
198207 - name : Set up Go
199208 uses : actions/setup-go@v6
@@ -248,4 +257,4 @@ jobs:
248257 with :
249258 name : image-metadata-${{ needs.metadata.outputs.release_tag }}
250259 path : dist/image-metadata/
251- if-no-files-found : warn
260+ if-no-files-found : warn
0 commit comments