-
Notifications
You must be signed in to change notification settings - Fork 44
120 lines (104 loc) · 3.13 KB
/
helm-test.yaml
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Lint/Test Helm charts
on:
pull_request:
branches: [ "main" ]
paths:
- 'charts/**'
jobs:
find_directories:
name: Find changed helm charts
runs-on: ubuntu-latest
outputs:
directories: ${{ steps.find_directories.outputs.build_matrix }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Check out the coredb repo to reuse some actions
uses: actions/checkout@v3
with:
repository: tembo-io/tembo
path: ./.tembo
ref: 84664df742ce9774a3029e08111940f9f1fb345e
- name: Find directories with Chart.yaml that changed
id: find_directories
uses: ./.tembo/.github/actions/find-changed-directories
with:
contains_the_file: Chart.yaml
changed_relative_to_branch: ${{ github.base_ref || 'not-a-branch' }}
ignore_dirs: ".tembo"
lint:
name: Lint charts
runs-on: ubuntu-latest
needs:
- find_directories
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.find_directories.outputs.directories) }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Helm lint
run: helm lint ${{ matrix.path }}
lint-ct:
name: Lint using chart-testing
runs-on: ubuntu-latest
needs:
- find_directories
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# yamllint (https://github.com/adrienverge/yamllint) which require Python
- name: Set up Python
uses: actions/setup-python@v4 #
with:
python-version: 3.x
- name: Set up Helm
uses: azure/[email protected]
with:
version: 3.13.2
- name: Set up chart-testing
uses: helm/[email protected]
- name: Install just
uses: extractions/setup-just@v1
- run: just helm-repo
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch main)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing linter
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config ct.yaml
test:
name: Test using chart-testing
runs-on: ubuntu-latest
needs: lint-ct
# if: needs.lint-ct.outputs.changed == 'true'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/[email protected]
with:
version: 3.13.2
- name: Set up chart-testing
uses: helm/[email protected]
- uses: extractions/setup-just@v1
- run: just helm-repo
- name: Install kind cluster
uses: helm/[email protected]
with:
install_only: true
- name: Start kind cluster
run: just start-kind
- name: Run helm chart tests
run: ct install --config ct.yaml