A GitHub Action to lint and test Helm charts, using the helm/chart-testing CLI tool.
master
supports Helm 3 only.
Support for Helm 2 is on branch dev-v2
.
- A GitHub repo containing a directory with your Helm charts (eg:
/charts
) - Optional: if you want to override the defaults, a chart-testing config file in your GitHub repo (eg.
/ct.yaml
) - A workflow YAML file in your
.github/workflows
directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file
For more information on inputs, see the API Documentation
image
: The chart-testing Docker image to use (default:quay.io/helmpack/chart-testing:v3.0.0-rc.1
)config
: The path to the config filecommand
: The chart-testing command to runkubeconfig
: The path to the kube config file
Create a workflow (eg: .github/workflows/lint-test.yaml
):
name: Lint and Test Charts
on: pull_request
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch history
run: git fetch --prune --unshallow
- name: Run chart-testing (lint)
id: lint
uses: helm/[email protected]
with:
command: lint
- name: Create kind cluster
uses: helm/[email protected]
# Only build a kind cluster if there are chart changes to test.
if: steps.lint.outputs.changed == 'true'
- name: Run chart-testing (install)
uses: helm/[email protected]
with:
command: install
This uses @helm/kind-action
GitHub Action to spin up a kind Kubernetes cluster, and @helm/chart-testing-action
to lint and test your charts on every Pull Request.
Participation in the Helm community is governed by the Code of Conduct.