56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
name: Lint and Test Charts
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- "charts/**"
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-20.04
|
|
container: ghcr.io/chgl/kube-powertools:latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Update dependencies
|
|
run: find charts/ ! -path charts/ -maxdepth 1 -type d -exec helm dependency update {} \;
|
|
- name: Run chart-testing (lint)
|
|
run: ct lint --config .github/ct/ct.yaml
|
|
- name: Run Powerlint
|
|
run: chart-powerlint.sh
|
|
|
|
test:
|
|
runs-on: ubuntu-20.04
|
|
needs:
|
|
- lint
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up Helm
|
|
uses: azure/setup-helm@v1
|
|
with:
|
|
version: v3.5.2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.9
|
|
- name: Set up chart-testing
|
|
uses: helm/chart-testing-action@v2.0.1
|
|
- 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: Create k8s Kind Cluster
|
|
uses: helm/kind-action@v1.1.0
|
|
if: steps.list-changed.outputs.changed == 'true'
|
|
- name: Run chart-testing (install)
|
|
run: ct install --config .github/ct/ct.yaml
|