-
-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (61 loc) · 1.8 KB
/
helm-lint-and-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
## Reference: https://github.com/helm/chart-testing-action
name: Linting and Testing
on:
push:
permissions:
contents: read
jobs:
linter-artifacthub:
runs-on: ubuntu-latest
container:
image: public.ecr.aws/artifacthub/ah:v1.17.0
options: --user 1001
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run ah lint
working-directory: ./charts
run: ah lint
chart-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.1
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Setup Chart Linting
id: lint
uses: helm/chart-testing-action@v2.7.0
with:
version: v3.10.0
- name: List changed charts
id: list-changed
run: |
## If executed with debug this won't work anymore.
changed=$(ct --config ./ci/ct-lint.yaml list-changed)
charts=$(echo "$changed" | tr '\n' ' ' | xargs)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "changed_charts=$charts" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing (lint)
run: ct lint --debug --config ./ci/ct-lint.yaml --lint-conf ./ci/lintconf.yaml
- name: Run docs-testing (helm-docs)
id: helm-docs
run: |
./ci/docs.sh
if [[ $(git diff --stat) != '' ]]; then
echo -e '\033[0;31mDocumentation outdated!\033[0m ❌'
git diff --color
exit 1
else
echo -e '\033[0;32mDocumentation up to date\033[0m ✔'
fi