helm-charts/.github/workflows/charts-lint.yaml
Bernd Schorgers a548690b00
feat(common): Release v2.5.0 (#258)
Co-authored-by: Maurits <75321636+maurits-funda@users.noreply.github.com>
Co-authored-by: Noam Lerner <bugok@users.noreply.github.com>
2024-01-16 20:28:41 +00:00

95 lines
2.5 KiB
YAML

name: "Charts: Lint"
on:
workflow_call:
inputs:
checkoutCommit:
required: true
type: string
isRenovatePR:
required: true
default: "false"
type: string
chartsToLint:
description: >
A JSON encoded array of charts to lint
required: true
type: string
overrideDeps:
description: >
A JSON encoded array of dependencies to override before linting
type: string
required: false
default: "[]"
env:
HELM_VERSION: 3.11.2
jobs:
lint-chart:
if: ${{ inputs.chartsToLint != '[]' }}
name: Lint chart
strategy:
matrix:
chart: ${{ fromJSON(inputs.chartsToLint) }}
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
ref: ${{ inputs.checkoutCommit }}
- name: Verify chart version
uses: bjw-s/helm-charts-actions/verify-chart-version@main
id: verify-chart-version
with:
chart: "charts/${{ matrix.chart }}"
- name: Verify chart changelog
uses: bjw-s/helm-charts-actions/verify-chart-changelog@main
if: inputs.isRenovatePR != 'true'
id: verify-chart-changelog
with:
chart: "charts/${{ matrix.chart }}"
- name: Install Kubernetes tools
uses: yokawasa/action-setup-kube-tools@v0.9.3
with:
setup-tools: |
helmv3
helm: "${{ env.HELM_VERSION }}"
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: Override chart dependencies
uses: ./.github/actions/override-chart-deps
if: ${{ inputs.overrideDeps != '[]' }}
with:
chart: ${{ matrix.chart }}
overrides: ${{ inputs.overrideDeps }}
- name: Run chart-testing (lint)
run: ct lint --config .ci/ct/ct.yaml --charts "charts/${{ matrix.chart }}"
lint_success:
needs:
- lint-chart
if: |
always()
name: Lint successful
runs-on: ubuntu-latest
steps:
- name: Check matrix status
if: >-
${{
(
inputs.chartsToLint != '' && inputs.chartsToLint != '[]'
) &&
(
contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
)
}}
run: exit 1