2525 - name : Run Helm unit tests
2626 run : make tests
2727
28- integration :
29- name : Integration Tests (K3s)
28+ k3s- integration-tests :
29+ name : K3s Integration Tests
3030 if : github.event.pull_request.head.repo.full_name == github.repository
3131 permissions :
3232 contents : ' read'
3636 steps :
3737 - uses : actions/checkout@v5
3838
39- - name : Start K3s cluster
39+ - name : Setup K3s cluster
4040 uses : jupyterhub/action-k3s-helm@v4
4141 with :
4242 k3s-channel : latest
@@ -47,106 +47,54 @@ jobs:
4747 - name : Set release name
4848 run : echo "RELEASE_NAME=eoapi-$(echo "${{ github.sha }}" | cut -c1-8)" >> "$GITHUB_ENV"
4949
50- - name : Deploy eoAPI
51- id : deploy
52- continue-on-error : true
50+ - name : Wait for K3s readiness
5351 run : |
54- echo "=== Starting eoAPI deployment ==="
55- export RELEASE_NAME="$RELEASE_NAME"
56- export PGO_VERSION="${{ env.PGO_VERSION }}"
57- export GITHUB_SHA="${{ github.sha }}"
58- ./scripts/deploy.sh --ci
52+ echo "=== Waiting for K3s cluster to be ready ==="
5953
60- - name : Check deployment status
61- id : check
62- if : steps.deploy.outcome == 'success'
63- run : |
64- echo "=== Checking deployment status ==="
65- export RELEASE_NAME="$RELEASE_NAME"
66- ./scripts/test.sh check-deployment --debug
54+ # The action already sets up kubectl context, just verify it works
55+ kubectl cluster-info
56+ kubectl get nodes
6757
68- - name : Debug pgstac jobs if deployment failed
69- if : steps.deploy.outcome == 'failure'
70- continue-on-error : true
71- run : |
72- echo "=== Debugging pgstac job failures ==="
73-
74- # Check pgstac-migrate job
75- echo "===== pgstac-migrate Job Status ====="
76- kubectl get jobs -l app.kubernetes.io/name=pgstac-migrate -o wide || echo "No pgstac-migrate jobs found"
77-
78- MIGRATE_PODS=$(kubectl get pods -l app.kubernetes.io/name=pgstac-migrate -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
79- if [ -n "$MIGRATE_PODS" ]; then
80- for POD in $MIGRATE_PODS; do
81- echo "--- Logs from migrate pod $POD ---"
82- kubectl logs "$POD" --tail=100 || true
83- echo "--- Description of migrate pod $POD ---"
84- kubectl describe pod "$POD"
85- done
86- fi
87-
88- # Check pgstac-load-samples job
89- echo "===== pgstac-load-samples Job Status ====="
90- kubectl get jobs -l app.kubernetes.io/name=pgstac-load-samples -o wide || echo "No pgstac-load-samples jobs found"
91-
92- SAMPLES_PODS=$(kubectl get pods -l app.kubernetes.io/name=pgstac-load-samples -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
93- if [ -n "$SAMPLES_PODS" ]; then
94- for POD in $SAMPLES_PODS; do
95- echo "--- Logs from samples pod $POD ---"
96- kubectl logs "$POD" --tail=100 || true
97- echo "--- Description of samples pod $POD ---"
98- kubectl describe pod "$POD"
99- done
100- fi
58+ # Wait for core components
59+ kubectl wait --for=condition=Ready pod -l k8s-app=kube-dns -n kube-system --timeout=300s
60+ kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=traefik -n kube-system --timeout=300s
10161
102- # Check database status
103- echo "===== Database Pod Status ====="
104- kubectl get pods -l postgres-operator.crunchydata.com/cluster -o wide
105- kubectl get postgrescluster -o wide
62+ # Verify Traefik CRDs
63+ timeout=300; counter=0
64+ for crd in "middlewares.traefik.io" "ingressroutes.traefik.io"; do
65+ while [ $counter -lt $timeout ] && ! kubectl get crd "$crd" &>/dev/null; do
66+ sleep 3; counter=$((counter + 3))
67+ done
68+ [ $counter -ge $timeout ] && { echo "❌ Timeout waiting for $crd"; exit 1; }
69+ done
10670
107- # Check ConfigMaps
108- echo "===== Relevant ConfigMaps ====="
109- kubectl get configmaps | grep -E "initdb|pgstac" || echo "No relevant configmaps found"
71+ echo "✅ K3s cluster ready"
11072
111- # Check for any related events
112- echo "===== Related Kubernetes Events ====="
113- kubectl get events | grep -E "pgstac|initdb" || echo "No relevant events found"
73+ - name : Deploy eoAPI
74+ id : deploy
75+ run : |
76+ echo "=== eoAPI Deployment ==="
77+ export RELEASE_NAME="${RELEASE_NAME}"
78+ export PGO_VERSION="${{ env.PGO_VERSION }}"
79+ export CI_MODE=true
11480
115- # Check notification system status
116- echo "===== Notification System Status ====="
117- kubectl get deployments -l app.kubernetes.io/name=eoapi-notifier -o wide || echo "No eoapi-notifier deployment found"
118- kubectl get ksvc -l app.kubernetes.io/component=cloudevents-sink -o wide || echo "No Knative CloudEvents sink found"
81+ # Deploy using consolidated script with CI mode
82+ ./scripts/deploy.sh --ci
11983
120- exit 1
84+ - name : Validate deployment
85+ run : |
86+ echo "=== Post-deployment validation ==="
87+ ./scripts/test.sh check-deployment
12188
12289 - name : Run integration tests
123- if : steps.deploy.outcome == 'success'
12490 run : |
125- echo "=== Running integration tests ==="
12691 export RELEASE_NAME="$RELEASE_NAME"
12792 ./scripts/test.sh integration --debug
12893
129- - name : Debug deployment status
130- if : always ()
94+ - name : Debug failed deployment
95+ if : failure ()
13196 run : |
132- echo "=== Final Deployment Status ==="
133- kubectl get pods -o wide
134- kubectl get jobs -o wide
135- kubectl get services -o wide
136- kubectl get ingress
137-
138- # Check notification system final status
139- echo "=== Notification System Final Status ==="
140- kubectl get deployments -l app.kubernetes.io/name=eoapi-notifier -o wide || echo "No eoapi-notifier deployment"
141- kubectl get pods -l app.kubernetes.io/name=eoapi-notifier -o wide || echo "No eoapi-notifier pods"
142- kubectl get ksvc -l app.kubernetes.io/component=cloudevents-sink -o wide || echo "No Knative CloudEvents sink"
143- kubectl get pods -l serving.knative.dev/service -o wide || echo "No Knative CloudEvents sink pods"
144-
145- # Show notification logs if they exist
146- echo "=== eoapi-notifier Logs ==="
147- kubectl logs -l app.kubernetes.io/name=eoapi-notifier --tail=20 || echo "No eoapi-notifier logs"
148- echo "=== Knative CloudEvents Sink Logs ==="
149- kubectl logs -l serving.knative.dev/service --tail=20 || echo "No Knative CloudEvents sink logs"
97+ ./scripts/debug-deployment.sh
15098
15199
152100 - name : Cleanup
0 commit comments