-
Notifications
You must be signed in to change notification settings - Fork 10
91 lines (77 loc) · 2.82 KB
/
lint-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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
env:
CT_BUILD_ID: '${{ github.run_id }}'
name: Chart Testing
on: [pull_request]
jobs:
build:
name: lint, install
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config charts/ct.yaml)
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
run: ct lint --debug --config charts/ct.yaml
- name: Create kind cluster
uses: helm/kind-action@v1.10.0
if: steps.list-changed.outputs.changed == 'true'
- name: Run chart-testing (install)
run: ct install --debug --config charts/ct.yaml --excluded-charts amazon-eks-pod-identity-webhook,keycloak-config-cli
diff:
name: check diff
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config charts/ct.yaml)
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "changed_list=\"${changed//$'\n'/ }\"" >> "$GITHUB_OUTPUT"
fi
- name: install helm diff plugin
if: steps.list-changed.outputs.changed == 'true'
run: |
helm env
helm plugin install https://github.com/databus23/helm-diff --version 3.9.9
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.10.0
- name: Run chart-testing (diff)
if: steps.list-changed.outputs.changed == 'true'
run: |
for chart in $changed_list; do
chart="${chart#*/}"
echo "installing chart: $chart"
if helm install --create-namespace --namespace "${chart}" \
"${chart}" "oci://ghcr.io/${{ github.repository_owner }}/charts/$chart"; then
helm diff upgrade "${chart}" "charts/${chart}" \
--namespace $chart \
--suppress=CustomResourceDefinition \
--normalize-manifests \
--reset-values \
--suppress-output-line-regex="chart: [0-9]" \
--suppress-output-line-regex="app.kubernetes.io/version: [0-9]"
else
echo "failed to install chart: $chart"
fi
done
env:
changed_list: ${{ steps.list-changed.outputs.changed_list }}