-
Notifications
You must be signed in to change notification settings - Fork 1
204 lines (176 loc) · 8.28 KB
/
Copy pathci.yaml
File metadata and controls
204 lines (176 loc) · 8.28 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
init:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: '3.13.0'
- name: Add Helm repositories and update dependencies
run: |
cd complex/
helm repo add cookielab https://helm.cookielab.dev
helm dependency update
helm dependency build
- name: Cache Helm dependencies
uses: actions/cache@v4
with:
path: |
complex/charts
key: helm-deps-${{ hashFiles('complex/Chart.yaml', 'complex/Chart.lock') }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: helm-dependencies
path: complex/charts
retention-days: 1
lint:
runs-on: ubuntu-latest
needs: init
steps:
- uses: actions/checkout@v4
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: '3.13.0'
- name: Download dependencies
uses: actions/download-artifact@v4
with:
name: helm-dependencies
path: complex/charts
- name: Lint all charts
run: |
# Lint library charts
echo "Linting library charts..."
helm lint lib-datadog
helm lint lib-gitlab
helm lint lib-kubernetes
helm lint lib-prometheus
# Lint prometheus-rules chart
echo "Linting prometheus-rules chart..."
helm lint prometheus-rules
# Lint complex chart with all testing-values configurations
echo "Linting complex chart with testing values..."
helm lint complex -f complex/testing-values/values-minimal.yaml
helm lint complex -f complex/testing-values/values-hpa.yaml
helm lint complex -f complex/testing-values/values-vpa.yaml
helm lint complex -f complex/testing-values/values-alerts.yaml
helm lint complex -f complex/testing-values/values-consumer.yaml
helm lint complex -f complex/testing-values/values-cronjob.yaml
helm lint complex -f complex/testing-values/values-ingress.yaml
helm lint complex -f complex/testing-values/values-targetgroups.yaml
helm lint complex -f complex/testing-values/values-configmap.yaml
helm lint complex -f complex/testing-values/values-volume-mounts.yaml
helm lint complex -f complex/testing-values/values-initcontainers.yaml
helm lint complex -f complex/testing-values/values-pvc-efs-shared.yaml
helm lint complex -f complex/testing-values/values-recreate.yaml
helm lint complex -f complex/testing-values/values-host-network.yaml
helm lint complex -f complex/testing-values/values-node-name.yaml
template-test:
runs-on: ubuntu-latest
needs: init
steps:
- uses: actions/checkout@v4
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: '3.13.0'
- name: Download dependencies
uses: actions/download-artifact@v4
with:
name: helm-dependencies
path: complex/charts
- name: Template test all configurations
run: |
echo "Testing all complex chart configurations..."
# Test basic configurations
helm template test ./complex --debug -f complex/testing-values/values-minimal.yaml
helm template test ./complex --debug -f complex/testing-values/values-hpa.yaml
helm template test ./complex --debug -f complex/testing-values/values-vpa.yaml
# Test feature configurations
helm template test ./complex --debug -f complex/testing-values/values-alerts.yaml
helm template test ./complex --debug -f complex/testing-values/values-consumer.yaml
helm template test ./complex --debug -f complex/testing-values/values-consumer-keda.yaml
helm template test ./complex --debug -f complex/testing-values/values-cronjob.yaml
# Test advanced configurations
helm template test ./complex --debug -f complex/testing-values/values-pre-job.yaml
helm template test ./complex --debug -f complex/testing-values/values-service-account.yaml
helm template test ./complex --debug -f complex/testing-values/values-security-context.yaml
helm template test ./complex --debug -f complex/testing-values/values-rolling-update.yaml
helm template test ./complex --debug -f complex/testing-values/values-pod-disruption-budget.yaml
helm template test ./complex --debug -f complex/testing-values/values-initcontainers.yaml
helm template test ./complex --debug -f complex/testing-values/values-pvc-efs-shared.yaml
helm template test ./complex --debug -f complex/testing-values/values-recreate.yaml
helm template test ./complex --debug -f complex/testing-values/values-host-network.yaml
helm template test ./complex --debug -f complex/testing-values/values-node-name.yaml
# Test infrastructure configurations
helm template test ./complex --debug -f complex/testing-values/values-ingress.yaml
helm template test ./complex --debug -f complex/testing-values/values-values-from.yaml
helm template test ./complex --debug -f complex/testing-values/values-targetgroups.yaml
helm template test ./complex --debug -f complex/testing-values/values-pull-secrets.yaml
helm template test ./complex --debug -f complex/testing-values/values-configmap.yaml
helm template test ./complex --debug -f complex/testing-values/values-volume-mounts.yaml
helm template test ./complex --debug -f complex/testing-values/values-tolerations.yaml
unit-test:
runs-on: ubuntu-latest
needs: init
steps:
- uses: actions/checkout@v4
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: '3.13.0'
- name: Download dependencies
uses: actions/download-artifact@v4
with:
name: helm-dependencies
path: complex/charts
- name: Install helm-unittest plugin
run: helm plugin install https://github.com/helm-unittest/helm-unittest --version 0.6.2
- name: Run unit tests
run: helm unittest complex
docs-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check complex chart documentation
run: |
echo "Checking complex chart documentation..."
docker run --rm -v ${{ github.workspace }}:/workdir -w /workdir jnorwood/helm-docs:v1.14.2 \
--chart-search-root=complex \
--template-files=_templates.gotmpl \
--template-files=README.md.gotmpl
if ! git diff --quiet complex/README.md; then
echo "WARNING: Complex chart documentation is out of date!"
echo "Run './scripts/update-docs.sh complex' locally and commit the changes."
echo "--- Expected changes ---"
git diff complex/README.md
echo "--- End of changes ---"
echo "Consider updating documentation, but continuing..."
else
echo "Complex chart documentation is up to date"
fi
- name: Check prometheus-rules chart documentation
run: |
echo "Checking prometheus-rules chart documentation..."
docker run --rm -v ${{ github.workspace }}:/workdir -w /workdir jnorwood/helm-docs:v1.14.2 \
--chart-search-root=prometheus-rules \
--template-files=_templates.gotmpl \
--template-files=README.md.gotmpl
if ! git diff --quiet prometheus-rules/README.md; then
echo "WARNING: Prometheus Rules chart documentation is out of date!"
echo "Run './scripts/update-docs.sh prometheus-rules' locally and commit the changes."
echo "--- Expected changes ---"
git diff prometheus-rules/README.md
echo "--- End of changes ---"
echo "Consider updating documentation, but continuing..."
else
echo "Prometheus Rules chart documentation is up to date"
fi