-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (78 loc) · 2.46 KB
/
chart-repo-test.yml
File metadata and controls
88 lines (78 loc) · 2.46 KB
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: Chart Repo Test
# Resources:
# * https://github.com/marketplace/actions/helm-chart-testing
# * https://github.com/helm/chart-testing-action
# * https://redhat-cop.github.io/ci/linting-testing-helm-charts.html
# * https://blog.ediri.io/auto-docs-test-and-release-a-helm-chart-with-github-actions
on:
workflow_call:
inputs:
chart_yaml_schema:
description: The Chart.yaml schema file path.
required: false
default: chart_schema.yaml
type: string
config:
description: The config file path.
required: false
default: ct.yaml
type: string
helm_version:
description: The version of Helm to use, e.g. 3.8.1.
required: false
default: 3.8.1
type: string
lint_conf:
description: The YAML lint config file path.
required: false
default: lintconf.yaml
type: string
python_version:
description: The version of Python to use, e.g. 3.7.
required: false
default: 3.7
type: string
target_branch:
description: The name of the target branch used to identify changed charts.
required: false
default: master
type: string
jobs:
ct-lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
path: .
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: ${{ inputs.helm_version }}
- name: Add dependency chart repos
run: |
helm repo add traefik https://helm.traefik.io/traefik
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.7.0
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
charts=$(echo "$changed" | tr '\n' ' ' | xargs)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "changed_charts=$charts" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing (lint)
run: |-
ct lint \
--chart-yaml-schema ${{ inputs.chart_yaml_schema }} \
--config ${{ inputs.config }} \
--lint-conf ${{ inputs.lint_conf }} \
--target-branch ${{ inputs.target_branch }}