Skip to content

Commit 4dc1650

Browse files
committed
ci: generated chart examples check
1 parent 56a8017 commit 4dc1650

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@ jobs:
3333
uses: golangci/golangci-lint-action@v3
3434
with:
3535
version: v1.54
36+
# Generate example charts
37+
- name: Generate example charts
38+
run: |
39+
cat test_data/sample-app.yaml | go run ./cmd/helmify examples/app
40+
cat test_data/k8s-operator-kustomize.output | go run ./cmd/helmify examples/operator
41+
- name: Check that chart examples were commited
42+
run: |
43+
if [[ -n "$(git status --porcelain)" ]]; then
44+
# Capture the list of uncommitted files
45+
UNCOMMITTED_FILES=$(git status --porcelain)
46+
echo "::error::Chart examples generation step has uncommitted changes: $UNCOMMITTED_FILES
47+
Please run following commands and commit the results:
48+
- \`cat test_data/sample-app.yaml | go run ./cmd/helmify examples/app\`
49+
- \`cat test_data/k8s-operator-kustomize.output | go run ./cmd/helmify examples/operator\`"
50+
exit 1
51+
else
52+
echo "Chart examples generation check passed. No uncommitted changes."
53+
fi
3654
# Dry-run generated charts in cluster
3755
- name: Install k8s cluster
3856
uses: helm/[email protected]

test_data/sample-app.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ spec:
2424
- name: app
2525
args:
2626
- --health-probe-bind-address=:8081
27-
- --metrics-bind-address=127.0.0.1:8080
28-
- --leader-elect
27+
# - --metrics-bind-address=127.0.0.1:8080
28+
# - --leader-elect
2929
command:
3030
- /manager
3131
volumeMounts:

0 commit comments

Comments
 (0)