-
Notifications
You must be signed in to change notification settings - Fork 213
86 lines (74 loc) · 2.78 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
name: CI
on:
pull_request:
branches:
- "*"
push:
jobs:
helm:
name: Helm chart
runs-on: ubuntu-latest
strategy:
matrix:
k8s: ["v1.23.17@sha256:14d0a9a892b943866d7e6be119a06871291c517d279aedb816a4b4bc0ec0a5b3", "v1.22.15@sha256:7d9708c4b0873f0fe2e171e2b1b7f45ae89482617778c1c875f1053d4cef2e41"]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Lint
run: |
docker run --rm --interactive --network host \
--name ct-lint \
--volume $PWD:/workdir \
--workdir /workdir/charts/apisix \
quay.io/helmpack/chart-testing:v3.4.0 sh -c 'helm dependency update \
&& cd ../.. \
&& helm repo add bitnami https://charts.bitnami.com/bitnami \
&& helm repo add apisix https://charts.apiseven.com \
&& ct lint \
--charts charts/apisix \
--charts charts/apisix-dashboard \
--charts charts/apisix-ingress-controller'
- name: fix permissions
run: |
sudo mkdir -p $HOME/.kube
sudo chmod -R 777 $HOME/.kube
- name: Create Kubernetes ${{ matrix.k8s }} cluster
id: kind
uses: ./.github/actions/setup-kind
with:
version: v0.22.0
config: test/e2e/kind.yaml
image: kindest/node:${{ matrix.k8s }}
- name: Test
env:
KIND_CLUSTER_NAME: kind
SKIP_CLUSTER_CREATION: true
run: |
kind get kubeconfig > $HOME/.kube/kind-config-kind
docker run --rm --interactive --network host \
--name ct \
--volume $HOME/.kube/kind-config-kind:/root/.kube/config \
--volume $PWD:/workdir \
--workdir /workdir/charts/apisix \
quay.io/helmpack/chart-testing:v3.4.0 sh -c 'helm dependency update \
&& cd ../.. \
&& helm repo add bitnami https://charts.bitnami.com/bitnami \
&& helm repo add apisix https://charts.apiseven.com \
&& ct install \
--charts charts/apisix'
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.19.2'
- name: Run helm-docs
run: |
GOBIN=$PWD GO111MODULE=on go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.11.0
./helm-docs --chart-search-root=${GITHUB_WORKSPACE}/charts
DIFF=$(git diff ${GITHUB_WORKSPACE}/charts/**/*md)
if [ ! -z "$DIFF" ]; then
echo "Please use helm-docs in your clone, of your fork, of the project, and commit a updated README.md for the chart."
fi
git diff --exit-code
rm -f ./helm-docs