-
Notifications
You must be signed in to change notification settings - Fork 4
88 lines (78 loc) · 2.39 KB
/
charts-lint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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.9.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@692973e3d937129bcbf40652eb9f2f61becf3332 # 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.11.1
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 }}"
# Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7
lint_success:
needs:
- lint-chart
if: |
always()
name: Lint successful
runs-on: ubuntu-22.04
steps:
- name: Check lint matrix status
if: ${{ (inputs.chartsToLint != '' && inputs.chartsToLint != '[]') && (needs.lint-chart.result != 'success') }}
run: exit 1