|
| 1 | +name: Lint and Test Charts |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [ main, master ] |
| 6 | + push: |
| 7 | + branches: [ main, master ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + lint-test: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout |
| 14 | + uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Install Helm |
| 17 | + |
| 18 | + |
| 19 | + - name: Add Bitnami repository |
| 20 | + run: helm repo add bitnami https://charts.bitnami.com/bitnami |
| 21 | + |
| 22 | + - name: Update Helm repositories |
| 23 | + run: helm repo update |
| 24 | + |
| 25 | + - name: Lint charts |
| 26 | + run: | |
| 27 | + for chart in */Chart.yaml; do |
| 28 | + chart_dir=$(dirname "$chart") |
| 29 | + echo "Linting $chart_dir..." |
| 30 | + helm lint "$chart_dir" |
| 31 | + done |
| 32 | +
|
| 33 | + - name: Validate chart dependencies |
| 34 | + run: | |
| 35 | + for chart in */Chart.yaml; do |
| 36 | + chart_dir=$(dirname "$chart") |
| 37 | + echo "Validating dependencies for $chart_dir..." |
| 38 | + helm dependency build "$chart_dir" |
| 39 | + helm dependency update "$chart_dir" |
| 40 | + done |
| 41 | +
|
| 42 | + - name: Test chart rendering |
| 43 | + run: | |
| 44 | + for chart in */Chart.yaml; do |
| 45 | + chart_dir=$(dirname "$chart") |
| 46 | + echo "Testing chart rendering for $chart_dir..." |
| 47 | + helm template test "$chart_dir" --values "$chart_dir/values.yaml" |
| 48 | + done |
| 49 | +
|
| 50 | + - name: Check for chart version bumps |
| 51 | + run: | |
| 52 | + for chart in */Chart.yaml; do |
| 53 | + chart_dir=$(dirname "$chart") |
| 54 | + echo "Checking version for $chart_dir..." |
| 55 | + if [ -f "$chart_dir/Chart.lock" ]; then |
| 56 | + echo "Chart.lock exists for $chart_dir - dependencies are locked" |
| 57 | + else |
| 58 | + echo "Warning: No Chart.lock found for $chart_dir" |
| 59 | + fi |
| 60 | + done |
0 commit comments