Skip to content

E2E

E2E #18

Workflow file for this run

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: |
BASE="https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.5.1"
# Install standard CRDs first (HTTPRoute has smaller annotations)
kubectl apply -f "$BASE/standard-install.yaml"
# Then add experimental CRDs (TCPRoute, UDPRoute, etc.)
# HTTPRoute update may fail due to large cel annotations on older K8s,
# but the standard version is already installed and functional
kubectl apply -f "$BASE/experimental-install.yaml" || true
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: Install kustomize
run: |
curl -sL "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.7.1/kustomize_v5.7.1_linux_amd64.tar.gz" | tar xz
sudo mv kustomize /usr/local/bin/
- name: Deploy nantian-gw
run: |
kustomize build deploy/kubernetes/overlays/kind-conformance --load-restrictor LoadRestrictionsNone | kubectl apply -f -
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 -l 'app.kubernetes.io/part-of=nantian-gw' --all-containers=true --tail=200 --prefix=true
- name: Cleanup
if: always()
run: kind delete cluster --name e2e