E2E #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E | |
| on: | |
| schedule: | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| packages: read | |
| jobs: | |
| smoke: | |
| name: Smoke | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create kind cluster | |
| run: | | |
| kind create cluster --name e2e --wait 5m | |
| kubectl wait --for=condition=ready node --all --timeout=2m | |
| - name: Install Gateway API CRDs | |
| run: | | |
| for i in 1 2 3; do | |
| kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.1/standard-install.yaml && break | |
| echo "Retry $i in 10s..." | |
| sleep 10 | |
| done | |
| kubectl wait --for=condition=established crd/gatewayclasses.gateway.networking.k8s.io --timeout=60s | |
| - name: Pre-load images into kind | |
| run: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin | |
| for img in nantian-controlplane dataplane dashboard; do | |
| docker pull "ghcr.io/nantian-gw/${img}:latest" | |
| kind load docker-image "ghcr.io/nantian-gw/${img}:latest" --name e2e | |
| done | |
| - name: Deploy nantian-gw | |
| run: | | |
| kubectl apply -k deploy/kubernetes/overlays/kind-conformance | |
| kubectl wait --for=condition=ready pod --all -n nantian-gw --timeout=300s | |
| - name: Record image versions | |
| run: | | |
| echo "=== Images under test ===" | |
| kubectl get pods -n nantian-gw -o json | jq -r '.items[] | .spec.containers[] | " \(.name): \(.image)"' | |
| echo "=== Image digests ===" | |
| kubectl get pods -n nantian-gw -o json | jq -r '.items[] | .status.containerStatuses[] | " \(.name): \(.imageID)"' | |
| - name: Run smoke test | |
| run: | | |
| CLUSTER_NAME=e2e ./test/e2e/smoke/run.sh --no-cleanup | |
| - name: Collect logs on failure | |
| if: failure() | |
| run: | | |
| kubectl describe pods -n nantian-gw | |
| kubectl logs -n nantian-gw --all-containers --tail=200 | |
| - name: Cleanup | |
| if: always() | |
| run: kind delete cluster --name e2e |