forked from argoproj/argo-helm
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
|
## Reference: https://github.com/helm/chart-testing-action
|
||
|
---
|
||
|
name: Linting and Testing
|
||
|
on: pull_request
|
||
|
jobs:
|
||
|
chart-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
|
||
|
|
||
|
- name: Set up python
|
||
|
uses: actions/setup-python@v2
|
||
|
with:
|
||
|
python-version: 3.7
|
||
|
|
||
|
- name: Setup Chart Linting
|
||
|
id: lint
|
||
|
uses: helm/chart-testing-action@v2.0.1
|
||
|
|
||
|
- name: List changed charts
|
||
|
id: list-changed
|
||
|
run: |
|
||
|
## If executed with debug this won't work anymore.
|
||
|
changed=$(ct --config ./.github/ct.yaml list-changed)
|
||
|
charts=$(echo "$changed" | tr '\n' ' ' | xargs)
|
||
|
if [[ -n "$changed" ]]; then
|
||
|
echo "::set-output name=changed::true"
|
||
|
echo "::set-output name=changed_charts::$charts"
|
||
|
fi
|
||
|
- name: Run chart-testing (lint)
|
||
|
run: ct lint --debug --config ./.github/ct.yaml --lint-conf ./.github/lintconf.yaml
|
||
|
|
||
|
- name: Create 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.yaml
|
||
|
if: steps.list-changed.outputs.changed == 'true'
|