-
Notifications
You must be signed in to change notification settings - Fork 277
111 lines (94 loc) · 2.63 KB
/
test-charts.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Lint and Test Charts
on:
pull_request:
paths:
- "charts/**"
jobs:
lint-chart:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
check-latest: true
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
echo "::set-output name=changed::[\"$(ct list-changed --config .github/ct-lint.yaml)\"]"
- name: Parse list-changed
id: set-matrix
env:
CHANGED: ${{ steps.list-changed.outputs.changed }}
run: |
echo "::set-output name=matrix::$(echo "${CHANGED//\\n/\",\"}")"
- name: Run chart-testing (lint)
run: ct lint --config .github/ct-lint.yaml
kubeconform-chart:
runs-on: ubuntu-latest
needs:
- lint-chart
strategy:
matrix:
chart: ${{ fromJson(needs.lint-chart.outputs.matrix) }}
k8s:
- "1.25.5"
- "1.24.9"
- "1.23.15"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update Helm depdendencies
env:
CHART_DIR: ${{ matrix.chart }}
run: |
helm dependency update "${CHART_DIR}"
mkdir tmp
helm template "${CHART_DIR}" > tmp/combined.yaml
- uses: yokawasa/[email protected]
with:
setup-tools: |
kubeconform
- name: Run kubeconform
if: ${{ matrix.k8s }}
run: kubeconform -kubernetes-version ${{ matrix.k8s }} tmp/combined.yaml
install-chart:
name: install-chart
runs-on: ubuntu-latest
needs:
- lint-chart
- kubeconform-chart
strategy:
matrix:
k8s:
- v1.25.3
- v1.24.7
- v1.23.13
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Create kind ${{ matrix.k8s }} cluster
uses: helm/[email protected]
with:
node_image: kindest/node:${{ matrix.k8s }}
- uses: actions/setup-python@v4
with:
python-version: "3.9"
check-latest: true
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (install)
run: ct install --config .github/ct-install.yaml