-
Notifications
You must be signed in to change notification settings - Fork 86
106 lines (95 loc) · 2.8 KB
/
test.yml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: test
on:
push:
branches:
- master
- main
- '!gh-pages'
paths-ignore:
- README.md
- .gitignore
pull_request:
branches:
- master
- main
- '!gh-pages'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
check-docs-update:
name: check-docs-update
runs-on: ubuntu-latest
container: jnorwood/helm-docs:v1.11.0
steps:
- name: Install git
run: |
apk add git
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Check for changes
run: |
# fix fatal: detected dubious ownership in repository at
git config --global --add safe.directory "$GITHUB_WORKSPACE"
helm-docs
if [ -z "$(git status --porcelain)" ]; then
echo "Docs are up-to-date"
else
echo "Docs are stale. Run helm-docs . locally. The following files have been changed:"
git diff
exit 1
fi
lint:
name: lint-charts
runs-on: ubuntu-latest
outputs:
IS_CHANGED: ${{ steps.list-changed.outputs.IS_CHANGED }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.11.0
- uses: actions/setup-python@v5
with:
python-version: '3.9'
check-latest: true
- name: Run chart-testing (prepare)
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --excluded-charts=kubernetes-chaos,kube-aws,kube-azure,kube-gcp,litmus-agent --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "IS_CHANGED=true" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing (lint)
run: |
ct lint --target-branch ${{ github.event.repository.default_branch }} --config=ct.yaml
deploy:
name: deploy-charts
runs-on: ubuntu-latest
if: needs.lint.outputs.IS_CHANGED == 'true'
needs: lint
strategy:
matrix:
k8s_version: [1.19.16, 1.20.15, 1.21.14, 1.22.15, 1.23.13, 1.24.7, 1.25.3]
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up chart-testing
uses: helm/[email protected]
- name: Create kind cluster
uses: helm/[email protected]
with:
node_image: kindest/node:v${{ matrix.k8s_version }}
wait: 180s
- name: Run chart-testing (install)
run: ct install --config ct.yaml