-
-
Notifications
You must be signed in to change notification settings - Fork 124
71 lines (64 loc) · 1.83 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
name: "Charts: Lint (Reusable)"
on:
workflow_call:
inputs:
charts:
description: >
Json encoded list of Helm charts to release.
Defaults to releasing everything.
default: "[]"
required: true
type: string
helmVersion:
description: >
Helm version to use.
default: "3.11.2"
required: false
type: string
jobs:
lint-chart:
if: ${{ inputs.charts != '[]' && inputs.charts != '' }}
name: Lint chart
strategy:
matrix:
chart: ${{ fromJSON(inputs.charts) }}
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Kubernetes tools
uses: yokawasa/action-setup-kube-tools@v0.11.2
with:
setup-tools: |
helmv3
helm: "${{ inputs.helmVersion }}"
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.7.0
- name: Dereference JSON schema
uses: bjw-s/helm-charts-actions/dereference-json-schema@main
with:
schemaFile: "charts/${{ matrix.chart }}/values.schema.json"
outputFile: "charts/${{ matrix.chart }}/values.schema.json"
allowFileNotFound: true
- 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