2021-07-07 07:04:15 +00:00
|
|
|
name: Lint and Test Charts
|
|
|
|
|
|
|
|
on:
|
2022-09-16 06:28:41 +00:00
|
|
|
pull_request:
|
2022-09-13 12:53:44 +00:00
|
|
|
types: [opened, synchronize, edited, reopened]
|
2021-07-07 07:04:15 +00:00
|
|
|
paths:
|
|
|
|
- 'charts/**'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint-docs:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Run helm-docs
|
|
|
|
run: .github/helm-docs.sh
|
|
|
|
install-chart:
|
|
|
|
name: install-chart
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
|
|
|
- lint-docs
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
k8s:
|
2022-09-16 06:28:41 +00:00
|
|
|
- v1.22.13
|
|
|
|
- v1.23.10
|
|
|
|
- v1.24.4
|
|
|
|
- v1.25.0
|
2021-07-07 07:04:15 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Create kind ${{ matrix.k8s }} cluster
|
2022-09-16 06:28:41 +00:00
|
|
|
uses: helm/kind-action@v1.3.0
|
2021-07-07 07:04:15 +00:00
|
|
|
with:
|
|
|
|
node_image: kindest/node:${{ matrix.k8s }}
|
|
|
|
- name: Set up chart-testing
|
2022-06-02 19:20:00 +00:00
|
|
|
uses: helm/chart-testing-action@v2.2.1
|
2021-07-07 07:04:15 +00:00
|
|
|
- name: Run chart-testing (list-changed)
|
|
|
|
id: list-changed
|
|
|
|
run: |
|
|
|
|
changed=$(ct list-changed --chart-dirs=charts --target-branch=main)
|
|
|
|
if [[ -n "$changed" ]]; then
|
|
|
|
echo "::set-output name=changed::true"
|
2022-06-23 05:49:45 +00:00
|
|
|
echo "::set-output name=changed_charts::\"${changed//$'\n'/,}\""
|
2021-07-07 07:04:15 +00:00
|
|
|
fi
|
|
|
|
- name: Run chart-testing (lint and install)
|
2022-06-23 05:49:45 +00:00
|
|
|
run: ct lint-and-install --chart-dirs=charts --target-branch=main --helm-extra-args="--timeout=15m" --charts=${{steps.list-changed.outputs.changed_charts}} --debug=true
|
|
|
|
if: steps.list-changed.outputs.changed == 'true'
|