Skip to content

Commit 69b16bd

Browse files
committed
github: Add chart lint and test action.
1 parent eb224b6 commit 69b16bd

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/helm-test.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: Helm lint and test
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
lint-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v5
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up Helm
19+
uses: azure/setup-helm@v4.2.0
20+
with:
21+
version: v3.17.0
22+
23+
- uses: actions/setup-python@v5.3.0
24+
with:
25+
python-version: "3.x"
26+
check-latest: true
27+
28+
- name: Set up chart-testing
29+
uses: helm/chart-testing-action@v2.7.0
30+
31+
- name: Run chart-testing (list-changed)
32+
id: list-changed
33+
run: |
34+
changed=$(ct list-changed --chart-dirs kubernetes/chart --target-branch ${{ github.event.repository.default_branch }})
35+
if [[ -n "$changed" ]]; then
36+
echo "changed=true" >> "$GITHUB_OUTPUT"
37+
fi
38+
39+
- name: Run chart-testing (lint)
40+
if: steps.list-changed.outputs.changed == 'true'
41+
run: ct lint --chart-dirs kubernetes/chart --target-branch ${{ github.event.repository.default_branch }}
42+
43+
- name: Create kind cluster
44+
if: steps.list-changed.outputs.changed == 'true'
45+
uses: helm/kind-action@v1.12.0
46+
47+
- name: Run chart-testing (install)
48+
if: steps.list-changed.outputs.changed == 'true'
49+
run: ct install --chart-dirs kubernetes/chart --target-branch ${{ github.event.repository.default_branch }}

0 commit comments

Comments
 (0)