-
Notifications
You must be signed in to change notification settings - Fork 209
110 lines (103 loc) · 2.72 KB
/
ci.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
name: ci
on:
pull_request:
env:
helm-version: "v3.9.0"
kubeval-version: "v0.16.1"
jobs:
lint-bash-scripts:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Lint Bash scripts
uses: docker://koalaman/shellcheck-alpine:v0.7.0
with:
args: .github/lint-scripts.sh
check-for-chart-changes:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch history
run: git fetch --prune --unshallow
- name: Check for chart changes
run: .github/check-for-chart-changes.sh
lint-chart:
runs-on: ubuntu-latest
needs: check-for-chart-changes
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch history
run: git fetch --prune --unshallow
- name: Run chart-testing (lint)
uses: helm/chart-testing-action@main
with:
command: lint
config: .github/ct.yaml
kubeval-chart:
runs-on: ubuntu-20.04
needs:
- lint-chart
strategy:
matrix:
k8s:
- v1.21.10
- v1.22.7
- v1.23.5
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/[email protected]
with:
version: "${{ env.helm-version }}"
- name: Run kubeval
env:
KUBERNETES_VERSION: ${{ matrix.k8s }}
KUBEVAL_VERSION: "${{ env.kubeval-version }}"
run: .github/kubeval.sh
install-chart:
name: install-chart
runs-on: ubuntu-latest
needs:
- lint-chart
- kubeval-chart
strategy:
matrix:
k8s:
- v1.21.10
- v1.22.7
- v1.23.5
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/[email protected]
with:
version: "${{ env.helm-version }}"
- uses: actions/[email protected]
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config .github/ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Create kind cluster
uses: helm/[email protected]
if: steps.list-changed.outputs.changed == 'true'
with:
config: .github/kind-config.yaml
node_image: kindest/node:${{ matrix.k8s }}
- name: Run chart-testing (install)
run: ct install --config .github/ct.yaml