@@ -43,3 +43,105 @@ jobs:
4343 tags : ghcr.io/${{ github.repository }}:pr-${{ github.event.pull_request.number }}
4444 cache-from : type=gha
4545 cache-to : type=gha,mode=max
46+
47+ helm-docs :
48+ runs-on : ubuntu-latest
49+ steps :
50+ - name : Checkout
51+ uses : actions/checkout@v5
52+
53+ - name : Run helm-docs
54+ uses : losisin/helm-docs-github-action@v1
55+ with :
56+ fail-on-diff : true
57+
58+ helm-test :
59+ runs-on : ubuntu-latest
60+ needs :
61+ - helm-docs
62+ - build
63+ steps :
64+ - name : Checkout
65+ uses : actions/checkout@v5
66+ with :
67+ fetch-depth : 0
68+
69+ - name : Set up Helm
70+ uses : azure/setup-helm@v4.2.0
71+ with :
72+ version : v3.17.0
73+
74+ - uses : actions/setup-python@v5.3.0
75+ with :
76+ python-version : " 3.x"
77+ check-latest : true
78+
79+ - name : Set up chart-testing
80+ uses : helm/chart-testing-action@v2.7.0
81+ with :
82+ version : 3.14.0
83+ yamllint_version : 1.37.1
84+ yamale_version : 6.0.0
85+
86+ - name : Set up helm repos
87+ run : |
88+ helm repo add groundhog2k https://groundhog2k.github.io/helm-charts/
89+
90+ - name : Run chart-testing (list-changed)
91+ id : list-changed
92+ run : |
93+ changed=$(ct list-changed --chart-dirs kubernetes/chart \
94+ --target-branch ${{ github.event.repository.default_branch }})
95+ if [[ -n "$changed" ]]; then
96+ echo "changed=true" >> "$GITHUB_OUTPUT"
97+ fi
98+
99+ - name : Run chart-testing (lint)
100+ if : steps.list-changed.outputs.changed == 'true'
101+ run : |
102+ ct lint --github-groups \
103+ --chart-dirs kubernetes/chart \
104+ --target-branch ${{ github.event.repository.default_branch }} \
105+ --lint-conf lintconf.yaml
106+
107+ - name : Create kind cluster
108+ if : steps.list-changed.outputs.changed == 'true'
109+ uses : helm/kind-action@v1
110+
111+ - name : Log in to GHCR
112+ if : steps.list-changed.outputs.changed == 'true'
113+ uses : docker/login-action@v3
114+ with :
115+ registry : ghcr.io
116+ username : ${{ github.actor }}
117+ password : ${{ secrets.GITHUB_TOKEN }}
118+
119+ - name : Load image into kind
120+ if : steps.list-changed.outputs.changed == 'true'
121+ run : |
122+ docker pull ghcr.io/${{ github.repository }}:pr-${{ github.event.pull_request.number }}
123+ kind load docker-image ghcr.io/${{ github.repository }}:pr-${{ github.event.pull_request.number }} --name chart-testing
124+
125+ - name : Run chart-testing (install)
126+ id : chart-testing-install
127+ if : steps.list-changed.outputs.changed == 'true'
128+ run : |
129+ ct install --github-groups \
130+ --chart-dirs kubernetes/chart \
131+ --target-branch ${{ github.event.repository.default_branch }} \
132+ --helm-extra-set-args "--values ./kubernetes/chart/zulip/ci/simple-values.yaml \
133+ --set image.tag=pr-${{ github.event.pull_request.number }}" \
134+ --skip-clean-up
135+
136+ - name : Fetch logs
137+ if : always()
138+ run : |
139+ namespace=$(helm list --all-namespaces --output json \
140+ | jq -r '[.[] | select(.namespace | startswith("zulip-"))][0].namespace')
141+ kubectl get pods -n "$namespace"
142+ for pod in $(kubectl get pods -n "$namespace" -o name); do
143+ kubectl describe "$pod" -n "$namespace"
144+ done
145+ pod=$(kubectl get pods -n "$namespace" -l app.kubernetes.io/name=zulip --output name)
146+ kubectl -n "$namespace" logs "$pod"
147+ kubectl -n "$namespace" exec "$pod" -c zulip -- cat /var/log/zulip/errors.log
0 commit comments