Skip to content

Commit f5bb531

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

File tree

8 files changed

+756
-999
lines changed

8 files changed

+756
-999
lines changed

.github/workflows/ci.yml

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