refactor helm ci tests part I (#11178)
* refactor helm ci tests part I Signed-off-by: cpanato <ctadeu@gmail.com> * update indentation Signed-off-by: cpanato <ctadeu@gmail.com> * fix path Signed-off-by: cpanato <ctadeu@gmail.com> * more updates Signed-off-by: cpanato <ctadeu@gmail.com> * add helm-lint job Signed-off-by: cpanato <ctadeu@gmail.com> --------- Signed-off-by: cpanato <ctadeu@gmail.com>
This commit is contained in:
parent
25d2758e94
commit
c0767ccc61
3 changed files with 64 additions and 35 deletions
20
hack/verify-chart-lint.sh → .ct.yaml
Executable file → Normal file
20
hack/verify-chart-lint.sh → .ct.yaml
Executable file → Normal file
|
@ -1,6 +1,4 @@
|
||||||
#!/bin/bash
|
# Copyright 2024 The Kubernetes Authors.
|
||||||
|
|
||||||
# Copyright 2020 The Kubernetes Authors.
|
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
|
@ -13,10 +11,16 @@
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
---
|
||||||
|
remote: origin
|
||||||
|
target-branch: main
|
||||||
|
|
||||||
set -o errexit
|
validate-maintainers: false
|
||||||
set -o nounset
|
check-version-increment: false
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
KUBE_ROOT="$( cd "$(dirname "$0")../" >/dev/null 2>&1 ; pwd -P )"
|
chart-repos:
|
||||||
ct lint --charts ${KUBE_ROOT}/charts/ingress-nginx --validate-maintainers=false
|
- ingress-nginx=https://kubernetes.github.io/ingress-nginx
|
||||||
|
helm-extra-args: --timeout 800s
|
||||||
|
|
||||||
|
chart-dirs:
|
||||||
|
- charts
|
65
.github/workflows/ci.yaml
vendored
65
.github/workflows/ci.yaml
vendored
|
@ -168,28 +168,30 @@ jobs:
|
||||||
name: docker.tar.gz
|
name: docker.tar.gz
|
||||||
path: docker.tar.gz
|
path: docker.tar.gz
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
helm:
|
|
||||||
name: Helm chart
|
helm-lint:
|
||||||
|
name: Helm chart lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- changes
|
- changes
|
||||||
- build
|
|
||||||
if: |
|
if: |
|
||||||
(needs.changes.outputs.charts == 'true') || (needs.changes.outputs.baseimage == 'true')
|
(needs.changes.outputs.charts == 'true') || (needs.changes.outputs.baseimage == 'true')
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
k8s: [v1.26.6, v1.27.3, v1.28.0, v1.29.0]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
|
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
|
||||||
|
|
||||||
- name: Setup Go
|
|
||||||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
|
|
||||||
with:
|
with:
|
||||||
go-version: ${{ needs.build.outputs.golangversion }}
|
fetch-depth: 0
|
||||||
check-latest: true
|
|
||||||
|
- name: Set up Helm
|
||||||
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
||||||
|
|
||||||
|
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
|
||||||
|
- name: Set up chart-testing
|
||||||
|
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
||||||
|
|
||||||
- name: Install Helm Unit Test Plugin
|
- name: Install Helm Unit Test Plugin
|
||||||
run: |
|
run: |
|
||||||
|
@ -199,14 +201,8 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
helm unittest charts/ingress-nginx -d
|
helm unittest charts/ingress-nginx -d
|
||||||
|
|
||||||
- name: cache
|
- name: Run chart-testing (lint)
|
||||||
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
|
run: ct lint --config ./.ct.yaml
|
||||||
with:
|
|
||||||
name: docker.tar.gz
|
|
||||||
|
|
||||||
- name: Lint
|
|
||||||
run: |
|
|
||||||
./build/run-in-docker.sh ./hack/verify-chart-lint.sh
|
|
||||||
|
|
||||||
- name: Run helm-docs
|
- name: Run helm-docs
|
||||||
run: |
|
run: |
|
||||||
|
@ -227,6 +223,35 @@ jobs:
|
||||||
./ah lint -p charts/ingress-nginx || exit 1
|
./ah lint -p charts/ingress-nginx || exit 1
|
||||||
rm -f ./ah ./ah_1.5.0_linux_amd64.tar.gz
|
rm -f ./ah ./ah_1.5.0_linux_amd64.tar.gz
|
||||||
|
|
||||||
|
helm-test:
|
||||||
|
name: Helm chart testing
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- changes
|
||||||
|
- build
|
||||||
|
- helm-lint
|
||||||
|
if: |
|
||||||
|
(needs.changes.outputs.charts == 'true') || (needs.changes.outputs.baseimage == 'true')
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
k8s: [v1.26.6, v1.27.3, v1.28.0, v1.29.0]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
|
||||||
|
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
|
||||||
|
with:
|
||||||
|
go-version: ${{ needs.build.outputs.golangversion }}
|
||||||
|
check-latest: true
|
||||||
|
|
||||||
|
- name: cache
|
||||||
|
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
|
||||||
|
with:
|
||||||
|
name: docker.tar.gz
|
||||||
|
|
||||||
- name: fix permissions
|
- name: fix permissions
|
||||||
run: |
|
run: |
|
||||||
sudo mkdir -p $HOME/.kube
|
sudo mkdir -p $HOME/.kube
|
||||||
|
|
Loading…
Reference in a new issue