From 91f52152c928e9744d6feea997082bd6c077a72f Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Wed, 30 Mar 2022 19:59:15 +0200 Subject: [PATCH] Update charts-lint.yaml --- .github/workflows/charts-lint.yaml | 76 ++++++++++++++++++++++-------- 1 file changed, 57 insertions(+), 19 deletions(-) diff --git a/.github/workflows/charts-lint.yaml b/.github/workflows/charts-lint.yaml index 93b4bbd0f24..667f18e0868 100644 --- a/.github/workflows/charts-lint.yaml +++ b/.github/workflows/charts-lint.yaml @@ -11,31 +11,26 @@ on: type: string jobs: - lint: - name: Lint charts + generate-lint-matrix: + name: Generate matrix for lint runs-on: ubuntu-latest + outputs: + matrix: | + { + "chart": ${{ steps.list-changed.outputs.charts }} + } + detected: ${{ steps.list-changed.outputs.detected }} steps: - name: Checkout - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3 + uses: actions/checkout@v3 with: fetch-depth: 0 ref: ${{ inputs.checkoutCommit }} - - name: Install Kubernetes tools - uses: yokawasa/action-setup-kube-tools@c81bf94cddd6c3172e6f61aa7f5ad66a2b5db98d # tag=v0.8.0 - with: - setup-tools: | - helmv3 - helm: "3.8.0" - - - uses: actions/setup-python@0ebf233433c08fb9061af664d501c3f3ff0e9e20 # tag=v3 - with: - python-version: "3.10" - - name: Set up chart-testing - uses: helm/chart-testing-action@dae259e86a35ff09145c0805e2d7dd3f7207064a # tag=v2.2.1 + uses: helm/chart-testing-action@v2.2.1 - - name: Collect changes + - name: Run chart-testing (list-changed) id: list-changed if: inputs.chartChangesDetected == 'true' run: | @@ -48,7 +43,50 @@ jobs: echo "::set-output name=detected::true" fi + lint-charts: + needs: + - generate-lint-matrix + if: needs.generate-lint-matrix.outputs.detected == 'true' + name: lint charts + strategy: + matrix: ${{ fromJson(needs.generate-lint-matrix.outputs.matrix) }} + fail-fast: true + max-parallel: 15 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: ${{ inputs.checkoutCommit }} + + - name: lint Kubernetes tools + uses: yokawasa/action-setup-kube-tools@v0.8.0 + with: + setup-tools: | + helmv3 + helm: "3.8.0" + + - uses: actions/setup-python@v3 + with: + python-version: "3.10" + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + - name: Run chart-testing (lint) - id: lint - if: steps.list-changed.outputs.detected == 'true' - run: ct lint --config .github/ct-lint.yaml + run: ct lint --config .github/ct-lint.yaml --charts ${{ matrix.chart }} + + # Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7 + lint_success: + needs: + - generate-lint-matrix + - lint-charts + if: | + always() + name: Lint successful + runs-on: ubuntu-latest + steps: + - name: Check lint matrix status + if: ${{ (needs.generate-lint-matrix.outputs.detected == 'true') && (needs.lint-charts.result != 'success') }} + run: exit 1