-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (65 loc) · 2.1 KB
/
chart-lint-and-test.yaml
File metadata and controls
78 lines (65 loc) · 2.1 KB
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
71
72
73
74
75
76
77
78
## Reference: https://github.com/helm/chart-testing-action
name: Chart Lint and Test
on: pull_request
permissions:
contents: read
jobs:
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.2
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup Chart Linting
id: lint
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # tag=v2.6.1
with:
version: v3.7.1
- name: Run docs-testing (helm-docs)
id: helm-docs
run: |
./scripts/helm-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
- name: List changed charts
id: list-changed
run: |
## If executed with debug this won't work anymore.
changed=$(ct --config ./.github/configs/ct-lint.yaml list-changed)
if [[ -n "$changed" ]]; then
echo "changed=true >> $GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
run: ct lint --config ./.github/configs/ct-lint.yaml
- name: Create kind cluster
uses: helm/kind-action@v1.8.0
if: steps.list-changed.outputs.changed == 'true'
- name: Run chart-testing (install)
run: ct install
if: steps.list-changed.outputs.changed == 'true'
# Check CRD update
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
cache: true
# Build release manifests and test against chart versions
- name: Check CRD status
run: |
rm -rf config/release
make manifest-build
diff -q config/release/crds.yaml charts/bifrost-gateway-controller/crds/crds.yaml