Skip to content

Instantly share code, notes, and snippets.

@wshihadeh
Created February 22, 2021 16:00
Show Gist options
  • Save wshihadeh/8319dc87837f95bfa94f2b5e6f890511 to your computer and use it in GitHub Desktop.
Save wshihadeh/8319dc87837f95bfa94f2b5e6f890511 to your computer and use it in GitHub Desktop.
Helm CI Integration
name: Lint and Test Helm chart
on: pull_request
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.0.1
- name: Execute Unit tests
run: |
helm unittest --color --update-snapshot .
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Lint the chart resources
run: ct lint
- name: Create kind cluster for testing the chart
uses: helm/kind-action@v1.0.0
if: steps.list-changed.outputs.changed == 'true'
- name: Test chart installation
run: ct install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment