Repository navigation
82 lines (73 loc) · 2.2 KB
/
Copy pathhelm-lint.yaml
File metadata and controls
82 lines (73 loc) · 2.2 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
name: Helm Lint and Test
on:
push:
branches: [ main, develop ]
paths:
- 'charts/**'
pull_request:
branches: [ main, develop ]
paths:
- 'charts/**'
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: 'latest'
- name: Add Helm repositories
run: |
helm repo add stakewise https://charts.stakewise.io
helm repo update
- name: Install Helm dependencies
run: |
for chart in charts/*/; do
if [ -f "$chart/Chart.yaml" ]; then
echo "Installing dependencies for $chart"
helm dependency update "$chart"
fi
done
- name: Lint Helm charts
run: |
for chart in charts/*/; do
if [ -f "$chart/Chart.yaml" ]; then
echo "Linting $chart"
helm lint "$chart"
fi
done
- name: Template Helm charts
run: |
for chart in charts/*/; do
if [ -f "$chart/Chart.yaml" ]; then
echo "Templating $chart"
helm template test "$chart" --debug
fi
done
- name: Package Helm charts
run: |
for chart in charts/*/; do
if [ -f "$chart/Chart.yaml" ]; then
echo "Packaging $chart"
helm package "$chart"
fi
done
- name: Run Helm tests (if available)
run: |
for chart in charts/*/; do
if [ -f "$chart/Chart.yaml" ]; then
echo "Checking for tests in $chart"
if [ -d "$chart/templates/tests" ]; then
echo "Test templates found in $chart"
# Note: Actual test execution would require a Kubernetes cluster
# This step validates that test templates can be rendered
helm template test "$chart" --show-only templates/tests/ || true
else
echo "No test templates found in $chart - skipping"
fi
fi
done