forked from joeferner/redis-commander
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (132 loc) · 3.9 KB
/
chart-test.yml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Lint and Test Charts
# code and jobs are mostly taken from https://jamiemagee.co.uk/blog/how-to-host-your-helm-chart-repository-on-github/
# and adapted for newer version of the test tools
#
# - ct - Helm project created Chart Testing, AKA ct, as a comprehensive linting tool for Helm charts
# - Helm-docs - not strictly a linting tool, but it makes sure that your documentation stays up-to-date with the current
# state of your chart
# - Kubeval - It validates the output from Helm against schemas generated from the Kubernetes OpenAPI specification
#
# not used by now:
# - Kubernetes in Docker (KIND) - use Chart Testing again to install your Helm charts on a Kubernetes cluster running in
# the GitHub Actions runner using Kubernetes in Docker (KIND)
on:
pull_request:
paths:
- 'k8s/helm-chart/**'
push:
branches-ignore:
- 'gh-pages'
paths:
- 'k8s/helm-chart/**'
env:
HELM_VERSION: v3.8.1
jobs:
lint-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: ${{ env.HELM_VERSION }}
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (lint)
run: "ct lint --config .github/ct.yml --chart-dirs k8/helm-chart"
lint-docs:
runs-on: ubuntu-latest
needs: lint-chart
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run helm-docs
run: ".github/helm-docs.sh"
kubeval-chart:
runs-on: ubuntu-latest
needs:
- lint-chart
- lint-docs
strategy:
matrix:
k8s:
- v1.11.10 # for openshift 3.11
#- v1.16.15
#- v1.17.14
#- v1.18.20
- v1.19.16
#- v1.20.15
- v1.21.14
#- v1.22.15
- v1.23.12
#- v1.24.6
- v1.25.10
- v1.27.2
include:
- k8s: v1.11.10
legacy_ingress: true
- k8s: v1.19.16
legacy_ingress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: ${{ env.HELM_VERSION }}
- name: Run kubeval with legacy ingress for older k8s
if: ${{ matrix.legacy_ingress }}
env:
KUBERNETES_VERSION: ${{ matrix.k8s }}
HELM_VALUES: "--set ingress.enabled=true --set ingress.legacy=true"
run: ".github/kubeval.sh"
- name: Run kubeval with new ingress
if: ${{ ! matrix.legacy_ingress }}
env:
KUBERNETES_VERSION: ${{ matrix.k8s }}
HELM_VALUES: "--set ingress.enabled=true"
run: ".github/kubeval.sh"
# install-chart:
# name: install chart on KIND
# runs-on: ubuntu-latest
# needs:
# - lint-chart
# - lint-docs
# - kubeval-chart
# strategy:
# matrix:
# # not all k8s version are supported - check https://hub.docker.com/r/kindest/node/tags?page=1&ordering=last_updated
# k8s:
# - v1.11.10 # for openshift 3.11
# #- v1.16.15
# #- v1.17.17
# - v1.18.20
# - v1.19.16
# - v1.20.15
# - v1.21.14
# - v1.22.15
# - v1.23.12
# - v1.24.6
# - v1.25.2
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Create kind ${{ matrix.k8s }} cluster
# uses: helm/kind-action@master
# with:
# node_image: kindest/node:${{ matrix.k8s }}
# - name: Run chart-testing (install)
# uses: helm/chart-testing-action@master
# with:
# command: install
# config: .github/ct.yaml