-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.74 KB
/
test.yml
File metadata and controls
63 lines (53 loc) · 1.74 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
name: Test
on:
pull_request:
branches: [main]
push:
branches: [main]
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: azure/setup-helm@v4
with:
version: v3.16.4
- name: Add chart repos
run: |
helm repo add cnpg https://cloudnative-pg.github.io/charts
helm repo add cerbos https://download.cerbos.dev/helm-charts
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo update
- name: Build dependencies
run: |
helm dependency build .
# helm 3 leaves sub-charts as .tgz; some helm versions / chart
# configurations error with "missing in charts/ directory" until the
# archives are extracted. Unpack so `helm lint` and `helm template`
# see the dirs.
for tgz in charts/*.tgz; do
tar -xzf "$tgz" -C charts/
done
ls -la charts/
- name: Lint
run: helm lint .
- name: Template (dev profile)
run: helm template plinth . --values values/dev.values.yaml > /tmp/dev.yaml
- name: Template (defaults)
run: helm template plinth . > /tmp/defaults.yaml
- name: Smoke — assert key resources are rendered
run: |
set -euo pipefail
for needle in \
"kind: Cluster" \
"name: plinth-cerbos-policies" \
"kind: Deployment" \
"kind: CustomResourceDefinition" ; do
if ! grep -q "$needle" /tmp/dev.yaml; then
echo "missing: $needle" >&2
exit 1
fi
done
echo "all expected resources present"