Skip to content

Commit 9f3bf6d

Browse files
oujonnymorete
authored andcommitted
feat: add GitHub Actions workflow for linting and testing Helm charts (kubeovn#6184)
* feat: add GitHub Actions workflow for linting and testing Helm charts Signed-off-by: oujonny <jonny@immerda.ch> * feat: restrict GitHub Actions workflow to specific paths for Helm chart testing Signed-off-by: oujonny <jonny@immerda.ch> * fix: disable maintainers validation Signed-off-by: oujonny <jonny@immerda.ch> * fix: remove tmp values Signed-off-by: oujonny <jonny@immerda.ch> --------- Signed-off-by: oujonny <jonny@immerda.ch>
1 parent 6b572d9 commit 9f3bf6d

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Lint and Test Charts
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'charts/kube-ovn-v2/**'
7+
- '.github/workflows/helm-testing.yaml'
8+
9+
10+
permissions: {}
11+
12+
jobs:
13+
lint-test:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
strategy:
18+
matrix:
19+
ip-family: [ "ipv4" ]
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v5.0.0
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Set up Helm
27+
uses: azure/setup-helm@v4.3.1
28+
29+
- uses: actions/setup-python@v6.0.0
30+
with:
31+
python-version: '3.x'
32+
check-latest: true
33+
34+
- name: Set up chart-testing
35+
uses: helm/chart-testing-action@v2.8.0
36+
37+
- name: Run chart-testing (list-changed)
38+
id: list-changed
39+
run: |
40+
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
41+
if [[ -n "$changed" ]]; then
42+
echo "changed=true" >> "$GITHUB_OUTPUT"
43+
fi
44+
45+
- name: Run chart-testing (lint)
46+
if: steps.list-changed.outputs.changed == 'true'
47+
run: |
48+
echo "validate-maintainers: false" > ct.yaml
49+
ct lint --target-branch ${{ github.event.repository.default_branch }} --config ct.yaml
50+
51+
- name: Install kind
52+
uses: helm/kind-action@v1.13.0
53+
with:
54+
version: ${{ env.KIND_VERSION }}
55+
install_only: true
56+
57+
- name: Create kind cluster
58+
run: |
59+
sudo pip3 install jinjanator j2cli
60+
sudo PATH=~/.local/bin:$PATH make kind-init-${{ matrix.ip-family }}
61+
sudo cp -r /root/.kube/ ~/.kube/
62+
sudo chown -R $(id -un). ~/.kube/
63+
64+
- name: Run chart-testing (install)
65+
if: steps.list-changed.outputs.changed == 'true'
66+
run: |
67+
kubectl label node --overwrite -l node-role.kubernetes.io/control-plane kube-ovn/role=master
68+
ct install --target-branch ${{ github.event.repository.default_branch }}

charts/kube-ovn-v2/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ apiVersion: v2
22
name: kube-ovn-v2
33
description: Helm chart for Kube-OVN
44
type: application
5-
version: v1.16.0
5+
version: v1.16.1
66
appVersion: "1.16.0"
77
kubeVersion: ">= 1.29.0-0"

0 commit comments

Comments
 (0)