Skip to content

Commit 5944156

Browse files
authored
feat: add chart testing ci (#199)
Signed-off-by: Ashing Zheng <[email protected]>
1 parent a9774cb commit 5944156

File tree

7 files changed

+120
-7
lines changed

7 files changed

+120
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
push:
8+
branches:
9+
- "main"
10+
11+
jobs:
12+
13+
helm:
14+
name: Helm chart
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: recursive
23+
24+
- name: Lint
25+
run: |
26+
docker run --rm --interactive --network host \
27+
--name ct-lint \
28+
--volume $PWD:/workdir \
29+
--workdir /workdir \
30+
quay.io/helmpack/chart-testing:v3.10.1 sh -c 'git config --global --add safe.directory /workdir \
31+
&& helm repo add bitnami https://charts.bitnami.com/bitnami \
32+
&& helm repo add apisix https://charts.apiseven.com \
33+
&& ct lint \
34+
--charts charts/api7 \
35+
--charts charts/gateway \
36+
--charts charts/ingress-controller'
37+
38+
- name: Setup Kubernetes
39+
uses: engineerd/[email protected]
40+
with:
41+
version: v0.22.0
42+
image: kindest/node:v1.31.0
43+
44+
- name: Test install charts
45+
run: |
46+
kubectl cluster-info
47+
docker run --rm --interactive --network host \
48+
--name ct \
49+
--volume $HOME/.kube/config:/root/.kube/config \
50+
--volume $PWD:/workdir \
51+
--workdir /workdir \
52+
quay.io/helmpack/chart-testing:v3.10.1 sh -c 'git config --global --add safe.directory /workdir \
53+
&& helm repo add bitnami https://charts.bitnami.com/bitnami \
54+
&& helm repo add apisix https://charts.apiseven.com \
55+
&& ct install \
56+
--charts charts/api7 \
57+
--charts charts/ingress-controller'
58+
59+
- name: Test gateway charts
60+
run: |
61+
kubectl cluster-info
62+
docker run --rm --interactive --network host \
63+
--name ct \
64+
--volume $HOME/.kube/config:/root/.kube/config \
65+
--volume $PWD:/workdir \
66+
--workdir /workdir \
67+
quay.io/helmpack/chart-testing:v3.10.1 sh -c 'git config --global --add safe.directory /workdir \
68+
&& helm repo add bitnami https://charts.bitnami.com/bitnami \
69+
&& helm repo add apisix https://charts.apiseven.com \
70+
&& ct install \
71+
--charts charts/gateway --helm-extra-set-args "--set etcd.enabled=true"'
72+
73+
- name: Setup Go
74+
uses: actions/setup-go@v4
75+
with:
76+
go-version: '1.23'
77+
78+
- name: Run helm-docs
79+
run: |
80+
go install github.com/norwoodj/helm-docs/cmd/[email protected]
81+
helm-docs --chart-search-root=${GITHUB_WORKSPACE}/charts
82+
DIFF=$(git diff ${GITHUB_WORKSPACE}/charts/*/README.md)
83+
if [ ! -z "$DIFF" ]; then
84+
echo "Please use helm-docs in your clone, of your fork, of the project, and commit an updated README.md for the chart."
85+
echo "$DIFF"
86+
exit 1
87+
fi

charts/api7/Chart.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ version: 0.17.20
2323
# It is recommended to use it with quotes.
2424
appVersion: "3.8.10"
2525

26+
maintainers:
27+
- name: API7
28+
29+
url: https://api7.ai
30+
2631
dependencies:
2732
- name: prometheus
2833
condition: prometheus.builtin

charts/api7/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
A Helm chart for Kubernetes
66

7+
## Maintainers
8+
9+
| Name | Email | Url |
10+
| ---- | ------ | --- |
11+
| API7 | <[email protected]> | <https://api7.ai> |
12+
713
## Requirements
814

915
| Repository | Name | Version |

charts/api7/values.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ prometheus:
235235
registry: docker.io
236236
repository: api7/prometheus
237237
tag: 2.48.1-debian-11-r0
238-
existingSecret: "" # name of existing secret to mount the path of prometheus client certs.
238+
existingSecret: "" # name of existing secret to mount the path of prometheus client certs.
239239
enableRemoteWriteReceiver: true
240240
enableAdminAPI: true
241241
serviceAccount:
@@ -305,15 +305,15 @@ dashboard_configuration:
305305
prometheus:
306306
addr: "http://api7-prometheus-server:9090"
307307
timeout: "30s"
308-
basic_auth: # access the prometheus with basic-auth
309-
username: "" # Basic-auth username. If the username is empty, basic-auth authentication is not performed when requesting prometheus.
308+
basic_auth: # access the prometheus with basic-auth
309+
username: "" # Basic-auth username. If the username is empty, basic-auth authentication is not performed when requesting prometheus.
310310
password: ""
311311
tls:
312312
server_name: ""
313313
insecure_skip_verify: false
314314
enable_client_cert: false
315315
key_file: "" # the file path of the private key for requesting prometheus, (e.g. /app/prometheus/certs/tls.key)
316-
cert_file: "" # the file path of the certificate for requesting prometheus, (e.g. /app/prometheus/certs/tls.crt)
316+
cert_file: "" # the file path of the certificate for requesting prometheus, (e.g. /app/prometheus/certs/tls.crt)
317317
ca_file: "" # the file path of the ca to verify the prometheus tls server. (e.g. /app/prometheus/certs/ca.crt)
318318
whitelist:
319319
- "/api/v1/query_range"
@@ -370,15 +370,15 @@ dp_manager_configuration:
370370
prometheus:
371371
addr: "http://api7-prometheus-server:9090"
372372
timeout: "30s"
373-
basic_auth: # access the prometheus with basic-auth
374-
username: "" # Basic-auth username. If the username is empty, basic-auth authentication is not performed when requesting prometheus.
373+
basic_auth: # access the prometheus with basic-auth
374+
username: "" # Basic-auth username. If the username is empty, basic-auth authentication is not performed when requesting prometheus.
375375
password: ""
376376
tls:
377377
server_name: ""
378378
insecure_skip_verify: false
379379
enable_client_cert: false
380380
key_file: "" # the file path of the private key for requesting prometheus, (e.g. /app/prometheus/certs/tls.key)
381-
cert_file: "" # the file path of the certificate for requesting prometheus, (e.g. /app/prometheus/certs/tls.crt)
381+
cert_file: "" # the file path of the certificate for requesting prometheus, (e.g. /app/prometheus/certs/tls.crt)
382382
ca_file: "" # the file path of the ca to verify the prometheus tls server. (e.g. /app/prometheus/certs/ca.crt)
383383
consumer_cache:
384384
size: 50000

charts/gateway/Chart.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ version: 0.2.22
2121
# follow Semantic Versioning. They should reflect the version the application is using.
2222
appVersion: "3.8.10"
2323

24+
maintainers:
25+
- name: API7
26+
27+
url: https://api7.ai
28+
2429
dependencies:
2530
- name: etcd
2631
version: 8.7.7

charts/ingress-controller/Chart.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ keywords:
88
type: application
99
version: 0.1.9
1010
appVersion: 2.0.4
11+
maintainers:
12+
- name: API7
13+
14+
url: https://api7.ai
1115
sources:
1216
- https://github.com/api7/api7-helm-chart

charts/ingress-controller/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
Ingress Controller for API7
66

7+
## Maintainers
8+
9+
| Name | Email | Url |
10+
| ---- | ------ | --- |
11+
| API7 | <[email protected]> | <https://api7.ai> |
12+
713
## Source Code
814

915
* <https://github.com/api7/api7-helm-chart>

0 commit comments

Comments
 (0)