Skip to content

Commit cfab36d

Browse files
committed
Add testing workflow for Helm chart
Signed-off-by: Martin Schurz <Martin.Schurz@telekom.de>
1 parent 2809871 commit cfab36d

2 files changed

Lines changed: 57 additions & 1 deletion

File tree

.github/workflows/lint-test.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Lint and Test Charts
2+
3+
on:
4+
# Run CI against all pushes (direct commits, also merged PRs), Pull Requests
5+
push:
6+
branches: [main]
7+
paths:
8+
- 'helm/**'
9+
- '.github/workflows/lint-test.yml'
10+
pull_request:
11+
# The branches below must be a subset of the branches above
12+
branches: [main]
13+
paths:
14+
- 'helm/**'
15+
- '.github/workflows/lint-test.yml'
16+
17+
jobs:
18+
lint-test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Set up Helm
27+
uses: azure/setup-helm@v4.2.0
28+
with:
29+
version: v3.17.0
30+
31+
- uses: actions/setup-python@v5.3.0
32+
with:
33+
python-version: '3.x'
34+
check-latest: true
35+
36+
- name: Set up chart-testing
37+
uses: helm/chart-testing-action@v2.7.0
38+
39+
- name: Run chart-testing (list-changed)
40+
id: list-changed
41+
run: |
42+
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
43+
if [[ -n "$changed" ]]; then
44+
echo "changed=true" >> "$GITHUB_OUTPUT"
45+
fi
46+
47+
- name: Run chart-testing (lint)
48+
if: steps.list-changed.outputs.changed == 'true'
49+
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
50+
51+
- name: Create kind cluster
52+
if: steps.list-changed.outputs.changed == 'true'
53+
uses: helm/kind-action@v1.12.0
54+
55+
- name: Run chart-testing (install)
56+
if: steps.list-changed.outputs.changed == 'true'
57+
run: ct install --target-branch ${{ github.event.repository.default_branch }}

helm/values.yaml.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ report:
2222
jobs: false
2323
cronjobs: false
2424
replicationcontrollers: false
25-
...

0 commit comments

Comments
 (0)