Skip to content

Commit 065e389

Browse files
committed
improvement(helm): kind install test + chart version-bump gate in CI
Benchmarked against the flagship OSS charts (ingress-nginx, argo-cd, kube-prometheus-stack, grafana, bitnami, cert-manager): sim already exceeds most of them on validation rigor (strict schema — 4 of 6 ship none; 82 unit tests vs argo-cd's zero; kubeconform manifest validation none of them run), but every top community chart repo actually installs the chart on a kind cluster in chart CI — the one majority practice we lacked. Adds: - install job: kind cluster, helm install with ci/default + a new small-footprint ci/kind-values.yaml overlay (default app requests of 4Gi can't schedule on a CI node), --wait, then the chart's helm test hook, with pod/event/log diagnostics on failure - version-bump job (PR-only): fails when helm/sim/** changes without a Chart.yaml version increment — argo/kps/grafana all enforce this
1 parent f01cef2 commit 065e389

2 files changed

Lines changed: 103 additions & 0 deletions

File tree

.github/workflows/helm.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,67 @@ jobs:
8484
--set copilot.server.env.OPENAI_API_KEY_1=ci-dummy-openai-key \
8585
--set externalDatabase.password=ci-dummy-password > /dev/null
8686
done
87+
88+
version-bump:
89+
name: Chart version bumped
90+
if: github.event_name == 'pull_request'
91+
runs-on: ${{ (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
92+
timeout-minutes: 5
93+
steps:
94+
- uses: actions/checkout@v4
95+
with:
96+
fetch-depth: 0
97+
- name: Require a Chart.yaml version bump when chart content changes
98+
run: |
99+
set -euo pipefail
100+
base="origin/${{ github.base_ref }}"
101+
git fetch origin "${{ github.base_ref }}" --depth=1
102+
if git diff --name-only "$base"...HEAD | grep -q '^helm/sim/'; then
103+
base_version=$(git show "$base:helm/sim/Chart.yaml" | awk '/^version:/ {print $2}')
104+
head_version=$(awk '/^version:/ {print $2}' helm/sim/Chart.yaml)
105+
echo "base=$base_version head=$head_version"
106+
if [ "$base_version" = "$head_version" ]; then
107+
echo "::error::helm/sim/** changed but Chart.yaml version did not (still $head_version). Bump it per SemVer."
108+
exit 1
109+
fi
110+
else
111+
echo "No chart changes; skipping."
112+
fi
113+
114+
install:
115+
name: Install on kind and run helm test
116+
needs: chart
117+
runs-on: ${{ (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
118+
timeout-minutes: 25
119+
steps:
120+
- uses: actions/checkout@v4
121+
122+
- name: Set up Helm
123+
uses: azure/setup-helm@v4
124+
with:
125+
version: v3.16.4
126+
127+
- name: Create kind cluster
128+
uses: helm/kind-action@v1
129+
with:
130+
version: v0.24.0
131+
132+
- name: Install chart
133+
run: |
134+
helm install sim helm/sim \
135+
--namespace sim --create-namespace \
136+
--values helm/sim/ci/default-values.yaml \
137+
--values helm/sim/ci/kind-values.yaml \
138+
--wait --timeout 15m
139+
140+
- name: Diagnostics on failure
141+
if: failure()
142+
run: |
143+
kubectl -n sim get pods -o wide || true
144+
kubectl -n sim get events --sort-by=.lastTimestamp | tail -40 || true
145+
kubectl -n sim describe pods | tail -100 || true
146+
kubectl -n sim logs deploy/sim-app -c migrations --tail=50 || true
147+
kubectl -n sim logs deploy/sim-app --tail=80 || true
148+
149+
- name: Run helm test
150+
run: helm test sim --namespace sim --timeout 5m

helm/sim/ci/kind-values.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# CI-only overlay for the kind install test: shrink resource requests so the
2+
# default configuration schedules on a small CI runner. Layered on top of
3+
# ci/default-values.yaml. Dummy sizing — never use in a deployment.
4+
app:
5+
resources:
6+
requests:
7+
cpu: 200m
8+
memory: 512Mi
9+
limits:
10+
cpu: 1000m
11+
memory: 2Gi
12+
13+
realtime:
14+
resources:
15+
requests:
16+
cpu: 50m
17+
memory: 128Mi
18+
limits:
19+
cpu: 500m
20+
memory: 512Mi
21+
22+
migrations:
23+
resources:
24+
requests:
25+
cpu: 100m
26+
memory: 256Mi
27+
limits:
28+
cpu: 500m
29+
memory: 1Gi
30+
31+
postgresql:
32+
resources:
33+
requests:
34+
cpu: 100m
35+
memory: 256Mi
36+
limits:
37+
memory: 1Gi
38+
persistence:
39+
size: 2Gi

0 commit comments

Comments
 (0)