Skip to content

Commit 89e479b

Browse files
committed
Improved CI and local debugging.
1 parent 0696040 commit 89e479b

File tree

8 files changed

+762
-996
lines changed

8 files changed

+762
-996
lines changed

.github/workflows/ci.yml

Lines changed: 86 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: CI tests
22

33
on:
44
push:
@@ -11,8 +11,8 @@ env:
1111
PGO_VERSION: 5.7.4
1212

1313
jobs:
14-
validate:
15-
name: Lint checks
14+
fast-checks:
15+
name: Simple tests
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v5
@@ -21,9 +21,6 @@ jobs:
2121
with:
2222
node-version: '24'
2323

24-
- name: Install ajv-cli
25-
run: npm install -g ajv-cli ajv-formats
26-
2724
- name: Install Helm
2825
uses: azure/setup-helm@v4
2926
with:
@@ -32,8 +29,91 @@ jobs:
3229
- name: Setup Helm dependencies
3330
run: ./scripts/deploy.sh setup
3431

32+
- name: Install ajv-cli
33+
run: npm install -g ajv-cli ajv-formats
34+
3535
- name: Run linters
3636
run: make lint
3737

3838
- name: Validate Helm values schema
3939
run: make validate-schema
40+
41+
- name: Run Helm unit tests
42+
run: make tests
43+
44+
integration-tests:
45+
name: Integration tests
46+
needs: fast-checks
47+
if: github.event.pull_request.head.repo.full_name == github.repository
48+
permissions:
49+
contents: 'read'
50+
id-token: 'write'
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v5
54+
55+
- name: Start K3s cluster
56+
uses: jupyterhub/action-k3s-helm@v4
57+
with:
58+
k3s-channel: latest
59+
helm-version: ${{ env.HELM_VERSION }}
60+
metrics-enabled: false
61+
docker-enabled: true
62+
63+
- name: Set release name
64+
run: echo "RELEASE_NAME=eoapi-$(echo "${{ github.sha }}" | cut -c1-8)" >> "$GITHUB_ENV"
65+
66+
- name: Wait for K3s readiness
67+
run: |
68+
echo "=== Waiting for K3s cluster to be ready ==="
69+
70+
# The action already sets up kubectl context, just verify it works
71+
kubectl cluster-info
72+
kubectl get nodes
73+
74+
# Wait for core components
75+
kubectl wait --for=condition=Ready pod -l k8s-app=kube-dns -n kube-system --timeout=300s
76+
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=traefik -n kube-system --timeout=300s
77+
78+
# Verify Traefik CRDs
79+
timeout=300; counter=0
80+
for crd in "middlewares.traefik.io" "ingressroutes.traefik.io"; do
81+
while [ $counter -lt $timeout ] && ! kubectl get crd "$crd" &>/dev/null; do
82+
sleep 3; counter=$((counter + 3))
83+
done
84+
[ $counter -ge $timeout ] && { echo "❌ Timeout waiting for $crd"; exit 1; }
85+
done
86+
87+
echo "✅ K3s cluster ready"
88+
89+
- name: Deploy eoAPI
90+
id: deploy
91+
run: |
92+
echo "=== eoAPI Deployment ==="
93+
export RELEASE_NAME="${RELEASE_NAME}"
94+
export PGO_VERSION="${{ env.PGO_VERSION }}"
95+
export CI_MODE=true
96+
97+
# Deploy using consolidated script with CI mode
98+
./scripts/deploy.sh --ci
99+
100+
- name: Validate deployment
101+
run: |
102+
echo "=== Post-deployment validation ==="
103+
./scripts/test.sh check-deployment
104+
105+
- name: Run integration tests
106+
run: |
107+
export RELEASE_NAME="$RELEASE_NAME"
108+
./scripts/test.sh integration --debug
109+
110+
- name: Debug failed deployment
111+
if: failure()
112+
run: |
113+
./scripts/debug-deployment.sh
114+
115+
- name: Cleanup
116+
if: always()
117+
run: |
118+
helm uninstall "$RELEASE_NAME" -n eoapi || true
119+
kubectl delete namespace eoapi || true

.github/workflows/helm-tests.yml

Lines changed: 0 additions & 155 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- Added local testing with k3s and minikube
1212
- Base local development values file (`local-base-values.yaml`)
1313
- Unified local cluster management with `CLUSTER_TYPE` variable
14+
- Improved CI and local debugging; added debug-deployment.sh script
1415

1516
## [0.7.12] - 2025-10-17
1617

charts/eoapi/samples/cloudevents-sink.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)