-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (50 loc) · 2.21 KB
/
helm-lint.yml
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
name: Lint Helm Charts
on: [pull_request]
jobs:
lint-helm:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.14.4
- name: Set up chart-testing
uses: helm/[email protected]
with:
version: v3.10.1
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
echo "Changed charts: $changed"
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Install kubeconform
if: steps.list-changed.outputs.changed == 'true'
run: |
curl -L https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz | tar xvzf - && \
sudo mv kubeconform /usr/local/bin/
- name: Helm dependency update
if: steps.list-changed.outputs.changed == 'true'
run: |
helm dependency update ./charts/digma-ng
- name: Run Helm Lint #validates the chart structure and Helm-specific syntax.
if: steps.list-changed.outputs.changed == 'true'
run: |
helm lint ./charts/digma-ng --set digma.licenseKey="dummy-license-key"
- name: Validate Kubernetes Manifests #ensuring templates render without errors, kubeconform validates the rendered manifests against Kubernetes API schemas, ensuring they are deployable
if: steps.list-changed.outputs.changed == 'true'
run: |
set -e
helm template my-release ./charts/digma-ng --set digma.licenseKey="dummy-license-key" > output.yaml
kubeconform -strict output.yaml
# - name: Create k8s Kind Cluster # checking that resource dependencies are properly resolved (e.g., Secrets, ConfigMaps),close to real-world deployment.
# uses: helm/kind-action@v1
# - name: Dry Run Deployment
# run: |
# helm upgrade --install my-release ./charts/digma-ng --dry-run --debug --set digma.licenseKey="dummy-license-key"