Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Reusable Helm
on:
workflow_call:
inputs:
runner:
required: false
description: Runner type
default: ubuntu-latest
type: string
timeoutMinutes:
required: false
description: Maximum minutes before the job is cancelled
default: 40
type: number
chartsPath:
required: false
description: Directory searched for charts (every directory with a Chart.yaml)
default: .chart
type: string
jobs:
helm:
runs-on: ${{ inputs.runner }}
timeout-minutes: ${{ inputs.timeoutMinutes }}
steps:
- name: Checkout current git repository
uses: actions/checkout@v7

- name: Set up Helm
uses: azure/setup-helm@v5

- name: Lint and render charts
env:
CHARTS_PATH: ${{ inputs.chartsPath }}
run: |
set -euo pipefail
charts=()
while IFS= read -r chart; do
parent=$(dirname "$chart")
# A chart in <chart>/charts/ is a vendored dependency. It is validated
# through its parent, which supplies its values.
if [ "$(basename "$parent")" = charts ] && [ -f "$(dirname "$parent")/Chart.yaml" ]; then
continue
fi
charts+=("$chart")
done < <(find "$CHARTS_PATH" -name Chart.yaml -exec dirname {} \; | sort)
if [ ${#charts[@]} -eq 0 ]; then
echo "::error::No Chart.yaml found under $CHARTS_PATH"
exit 1
fi
for chart in "${charts[@]}"; do
echo "::group::$chart"
helm dependency build "$chart"
helm lint "$chart"
# Library charts render nothing and make `helm template` fail.
if ! helm show chart "$chart" | grep -q "^type: library"; then
helm template "$chart" > /dev/null
fi
echo "::endgroup::"
done
Loading