From 1b54c4bc0419b5f43a90ddbd5d57f8aa7281123e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Mon, 30 Nov 2020 10:05:02 +0100 Subject: [PATCH] Fix chart linter Without this patch, the lint action incorrectly returns everything is fine. This is a problem, as lint effectively is not running, and therefore we could merge broken charts. This fixes it by updating to the latest practices you can find in the official chart-repo-actions. (See the official example in ihttps://github.com/helm/charts-repo-actions-demo/blob/1a9640d9983d983404862daee9563fd871db3874/.github/workflows/lint-test.yaml) --- .github/workflows/on-pr-charts.yaml | 30 ++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/on-pr-charts.yaml b/.github/workflows/on-pr-charts.yaml index 40adcbe..5401a39 100644 --- a/.github/workflows/on-pr-charts.yaml +++ b/.github/workflows/on-pr-charts.yaml @@ -16,12 +16,19 @@ jobs: with: fetch-depth: "0" - - name: Lint charts - uses: helm/chart-testing-action@v2.0.1 + - uses: actions/setup-python@v2 with: - command: lint - config: .github/ct.yaml + python-version: 3.7 + # Helm is already present in github actions, so do not re-install it + - name: Setup chart testing + uses: helm/chart-testing-action@v2.0.1 + + - name: Run chart testing + run: ct lint --config .github/ct.yaml + + # We create two jobs instead of one to make those parallel. + # GH should cancel the rest of the workflow if lint is failing. test-chart: name: Install helm chart runs-on: ubuntu-latest @@ -31,11 +38,16 @@ jobs: with: fetch-depth: "0" + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + # Helm is already present in github actions, so do not re-install it + - name: Setup chart testing + uses: helm/chart-testing-action@v2.0.1 + - name: Create default kind cluster uses: helm/kind-action@v1.1.0 - - name: Install chart with chart-testing-action - uses: helm/chart-testing-action@v2.0.1 - with: - command: install - config: .github/ct.yaml + - name: Install chart with chart-testing + run: ct install