| --- |
| # SPDX-License-Identifier: Apache-2.0 |
| # SPDX-FileCopyrightText: 2026 The Linux Foundation |
| |
| name: Lint and Test Charts |
| description: "Lint and test Helm charts" |
| |
| inputs: |
| target-branch: |
| description: "Target branch to compare against for detecting changed charts" |
| required: true |
| |
| runs: |
| using: "composite" |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v5 |
| with: |
| fetch-depth: 0 |
| |
| - name: Set up Helm |
| uses: azure/setup-helm@v4.3.1 |
| |
| - uses: actions/setup-python@v6.0.0 |
| with: |
| python-version: "3.x" |
| check-latest: true |
| |
| - name: Set up chart-testing |
| uses: helm/chart-testing-action@v2.8.0 |
| |
| - name: Run chart-testing (list-changed) |
| id: list-changed |
| shell: bash |
| run: | |
| changed=$(ct list-changed --target-branch ${{ inputs.target-branch }}) |
| if [[ -n "$changed" ]]; then |
| echo "changed=true" >> "$GITHUB_OUTPUT" |
| fi |
| |
| - name: Run chart-testing (lint) |
| if: steps.list-changed.outputs.changed == 'true' |
| shell: bash |
| run: ct lint --target-branch ${{ inputs.target-branch }} |
| |
| - name: Create kind cluster |
| if: steps.list-changed.outputs.changed == 'true' |
| uses: helm/kind-action@v1.12.0 |
| |
| - name: Run chart-testing (install) |
| if: steps.list-changed.outputs.changed == 'true' |
| shell: bash |
| run: ct install --target-branch ${{ inputs.target-branch }} |