Skip to content

Commit 38a67c3

Browse files
authored
refactor: Improved CI and local debugging. (#326)
1 parent 0696040 commit 38a67c3

File tree

8 files changed

+754
-999
lines changed

8 files changed

+754
-999
lines changed

.github/workflows/ci.yml

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