-
Notifications
You must be signed in to change notification settings - Fork 4
107 lines (95 loc) · 4.06 KB
/
ci.yaml
File metadata and controls
107 lines (95 loc) · 4.06 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: CI
on:
pull_request:
branches:
- "main"
push:
branches:
- "main"
jobs:
helm:
name: Helm chart
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Lint
run: |
docker run --rm --interactive --network host \
--name ct-lint \
--volume $PWD:/workdir \
--workdir /workdir \
quay.io/helmpack/chart-testing:v3.10.1 sh -c 'git config --global --add safe.directory /workdir \
&& helm repo add bitnami https://charts.bitnami.com/bitnami \
&& helm repo add apisix https://charts.apiseven.com \
&& helm repo add jaegertracing https://jaegertracing.github.io/helm-charts \
&& ct lint \
--charts charts/api7 \
--charts charts/gateway \
--charts charts/ingress-controller'
- name: Verify Chart.lock files
run: |
docker run --rm --interactive --network host \
--volume "$PWD:/workdir" \
--workdir /workdir \
quay.io/helmpack/chart-testing:v3.10.1 sh -c '
helm repo add bitnami https://charts.bitnami.com/bitnami && \
helm repo add apisix https://charts.apiseven.com && \
helm repo add jaegertracing https://jaegertracing.github.io/helm-charts && \
for chart_dir in charts/*/; do
if [ -f "${chart_dir}Chart.lock" ]; then
echo "Verifying ${chart_dir}Chart.lock..."
helm dependency build "${chart_dir}"
fi
done
'
- name: Setup Kubernetes
uses: engineerd/setup-kind@v0.5.0
with:
version: v0.22.0
image: kindest/node:v1.31.0
- name: Test install charts
run: |
kubectl cluster-info
docker run --rm --interactive --network host \
--name ct \
--volume $HOME/.kube/config:/root/.kube/config \
--volume $PWD:/workdir \
--workdir /workdir \
quay.io/helmpack/chart-testing:v3.10.1 sh -c 'git config --global --add safe.directory /workdir \
&& helm repo add bitnami https://charts.bitnami.com/bitnami \
&& helm repo add apisix https://charts.apiseven.com \
&& helm repo add jaegertracing https://jaegertracing.github.io/helm-charts \
&& ct install \
--charts charts/api7 \
--charts charts/ingress-controller'
- name: Test gateway charts
run: |
kubectl cluster-info
docker run --rm --interactive --network host \
--name ct \
--volume $HOME/.kube/config:/root/.kube/config \
--volume $PWD:/workdir \
--workdir /workdir \
quay.io/helmpack/chart-testing:v3.10.1 sh -c 'git config --global --add safe.directory /workdir \
&& helm repo add bitnami https://charts.bitnami.com/bitnami \
&& helm repo add apisix https://charts.apiseven.com \
&& helm repo add jaegertracing https://jaegertracing.github.io/helm-charts \
&& ct install \
--charts charts/gateway --helm-extra-set-args "--set etcd.enabled=true --set apisix.extraEnvVars[0].name=API7_SKIP_FIRST_HEARTBEAT_DEBUG --set-string apisix.extraEnvVars[0].value=true"'
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Run helm-docs
run: |
go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.13.1
helm-docs --chart-search-root=${GITHUB_WORKSPACE}/charts
DIFF=$(git diff ${GITHUB_WORKSPACE}/charts/*/README.md)
if [ ! -z "$DIFF" ]; then
echo "Please use helm-docs in your clone, of your fork, of the project, and commit an updated README.md for the chart."
echo "$DIFF"
exit 1
fi