From 74f1c86f3fa5f2d34d36294a84588a2ecd82c4f1 Mon Sep 17 00:00:00 2001 From: Angel de la Torre Date: Wed, 7 Feb 2024 14:38:00 -0800 Subject: [PATCH] add helm chart testing action and ct config --- .github/workflows/helm.yaml | 49 +++++++++++++++++++++++++++++++++++++ charts/ct-config.yaml | 5 ++++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/helm.yaml create mode 100644 charts/ct-config.yaml diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml new file mode 100644 index 0000000..ed88953 --- /dev/null +++ b/.github/workflows/helm.yaml @@ -0,0 +1,49 @@ +name: Lint and Test Charts + +on: pull_request + +defaults: + run: + working-directory: helm/vigilo + +jobs: + helm-lint-and-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v3 + with: + version: v3.14.0 + + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + check-latest: true + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --config ./charts/ct-config.yaml) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Run chart-testing (lint) + if: steps.list-changed.outputs.changed == 'true' + run: ct lint --config ./charts/ct-config.yaml + + - name: Create kind cluster + if: steps.list-changed.outputs.changed == 'true' + uses: helm/kind-action@v1.8.0 + + - name: Run chart-testing (install) + if: steps.list-changed.outputs.changed == 'true' + run: ct install --config ./charts/ct-config.yaml \ No newline at end of file diff --git a/charts/ct-config.yaml b/charts/ct-config.yaml new file mode 100644 index 0000000..07ebdc0 --- /dev/null +++ b/charts/ct-config.yaml @@ -0,0 +1,5 @@ +charts-dir: + - charts +helm-extra-args: "--timeout=5m" +target-branch: main +validate-maintainers: false \ No newline at end of file