Skip to content

Commit c0767cc

Browse files
authored
refactor helm ci tests part I (#11178)
* refactor helm ci tests part I Signed-off-by: cpanato <[email protected]> * update indentation Signed-off-by: cpanato <[email protected]> * fix path Signed-off-by: cpanato <[email protected]> * more updates Signed-off-by: cpanato <[email protected]> * add helm-lint job Signed-off-by: cpanato <[email protected]> --------- Signed-off-by: cpanato <[email protected]>
1 parent 25d2758 commit c0767cc

File tree

3 files changed

+63
-34
lines changed

3 files changed

+63
-34
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#!/bin/bash
2-
3-
# Copyright 2020 The Kubernetes Authors.
1+
# Copyright 2024 The Kubernetes Authors.
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");
64
# you may not use this file except in compliance with the License.
@@ -13,10 +11,16 @@
1311
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1412
# See the License for the specific language governing permissions and
1513
# limitations under the License.
14+
---
15+
remote: origin
16+
target-branch: main
17+
18+
validate-maintainers: false
19+
check-version-increment: false
1620

17-
set -o errexit
18-
set -o nounset
19-
set -o pipefail
21+
chart-repos:
22+
- ingress-nginx=https://kubernetes.github.io/ingress-nginx
23+
helm-extra-args: --timeout 800s
2024

21-
KUBE_ROOT="$( cd "$(dirname "$0")../" >/dev/null 2>&1 ; pwd -P )"
22-
ct lint --charts ${KUBE_ROOT}/charts/ingress-nginx --validate-maintainers=false
25+
chart-dirs:
26+
- charts

.github/workflows/ci.yaml

+44-19
Original file line numberDiff line numberDiff line change
@@ -168,28 +168,30 @@ jobs:
168168
name: docker.tar.gz
169169
path: docker.tar.gz
170170
retention-days: 5
171-
helm:
172-
name: Helm chart
171+
172+
helm-lint:
173+
name: Helm chart lint
173174
runs-on: ubuntu-latest
174175
needs:
175176
- changes
176-
- build
177177
if: |
178178
(needs.changes.outputs.charts == 'true') || (needs.changes.outputs.baseimage == 'true')
179179
180-
strategy:
181-
matrix:
182-
k8s: [v1.26.6, v1.27.3, v1.28.0, v1.29.0]
183-
184180
steps:
185181
- name: Checkout
186182
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
183+
with:
184+
fetch-depth: 0
187185

188-
- name: Setup Go
189-
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
186+
- name: Set up Helm
187+
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
188+
189+
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
190190
with:
191-
go-version: ${{ needs.build.outputs.golangversion }}
192-
check-latest: true
191+
python-version: '3.x'
192+
193+
- name: Set up chart-testing
194+
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
193195

194196
- name: Install Helm Unit Test Plugin
195197
run: |
@@ -199,14 +201,8 @@ jobs:
199201
run: |
200202
helm unittest charts/ingress-nginx -d
201203
202-
- name: cache
203-
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
204-
with:
205-
name: docker.tar.gz
206-
207-
- name: Lint
208-
run: |
209-
./build/run-in-docker.sh ./hack/verify-chart-lint.sh
204+
- name: Run chart-testing (lint)
205+
run: ct lint --config ./.ct.yaml
210206

211207
- name: Run helm-docs
212208
run: |
@@ -227,6 +223,35 @@ jobs:
227223
./ah lint -p charts/ingress-nginx || exit 1
228224
rm -f ./ah ./ah_1.5.0_linux_amd64.tar.gz
229225
226+
helm-test:
227+
name: Helm chart testing
228+
runs-on: ubuntu-latest
229+
needs:
230+
- changes
231+
- build
232+
- helm-lint
233+
if: |
234+
(needs.changes.outputs.charts == 'true') || (needs.changes.outputs.baseimage == 'true')
235+
236+
strategy:
237+
matrix:
238+
k8s: [v1.26.6, v1.27.3, v1.28.0, v1.29.0]
239+
240+
steps:
241+
- name: Checkout
242+
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
243+
244+
- name: Setup Go
245+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
246+
with:
247+
go-version: ${{ needs.build.outputs.golangversion }}
248+
check-latest: true
249+
250+
- name: cache
251+
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
252+
with:
253+
name: docker.tar.gz
254+
230255
- name: fix permissions
231256
run: |
232257
sudo mkdir -p $HOME/.kube

charts/ingress-nginx/Chart.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ description: Ingress controller for Kubernetes using NGINX as a reverse proxy an
99
home: https://github.com/kubernetes/ingress-nginx
1010
icon: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png
1111
keywords:
12-
- ingress
13-
- nginx
12+
- ingress
13+
- nginx
1414
kubeVersion: '>=1.20.0-0'
1515
maintainers:
16-
- name: Gacko
17-
- name: rikatz
18-
- name: strongjz
19-
- name: tao12345666333
16+
- name: Gacko
17+
- name: rikatz
18+
- name: strongjz
19+
- name: tao12345666333
2020
name: ingress-nginx
2121
sources:
22-
- https://github.com/kubernetes/ingress-nginx
22+
- https://github.com/kubernetes/ingress-nginx
2323
version: 4.10.0

0 commit comments

Comments
 (0)