Skip to content

Commit 6f56e34

Browse files
authored
Fix chart testing action (#65)
1 parent 36f241a commit 6f56e34

File tree

2 files changed

+49
-26
lines changed

2 files changed

+49
-26
lines changed

.github/workflows/helm-workflow.yaml

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ on:
77
branches:
88
- main
99
env:
10-
HELM_VERSION: v3.12.1
10+
HELM_VERSION: v3.15.4
11+
HELMFILE_VERSION: v0.167.1
1112
PYTHON_VERSION: 3.9
1213
jobs:
1314
lint:
@@ -79,8 +80,6 @@ jobs:
7980
if [[ -n "$changed" ]]; then
8081
echo "changed=true" >> "$GITHUB_OUTPUT"
8182
fi
82-
- name: Setup helmfile
83-
uses: mamezou-tech/setup-helmfile@v1.2.0
8483
- name: Prepare a config for the kind cluster
8584
run: |
8685
cat > kind-config.yaml <<EOF
@@ -97,34 +96,50 @@ jobs:
9796
with:
9897
node_image: kindest/node:${{ matrix.k8s_version }}
9998
config: ./kind-config.yaml
100-
- name: Test db-operator charts install
99+
100+
- uses: helmfile/helmfile-action@v1.0.0
101+
with:
102+
helmfile-version: ${{ env.HELMFILE_VERSION }}
103+
helm-version: ${{ env.HELM_VERSION }}
104+
helm-plugins: >
105+
https://github.com/databus23/helm-diff, https://github.com/jkroepke/helm-secrets
106+
helmfile-args: sync --wait
107+
108+
- name: Test the db-operator chart install
101109
run: |
102-
helmfile -l name=prometheus-stack sync
103-
helmfile sync
104110
ct install --target-branch main --charts ./charts/db-operator
105111
helmfile destroy
106-
# Test is broken because of the image in the previous version,
107-
# so upgrate can't pass
108-
#- name: Test db-operator charts upgrade
109-
# run: |
110-
# helmfile -l name=prometheus-stack sync
111-
# helmfile sync
112-
# ct install --target-branch main --charts ./charts/db-operator --upgrade
113-
# helmfile destroy
112+
113+
- uses: helmfile/helmfile-action@v1.0.0
114+
with:
115+
helmfile-version: ${{ env.HELMFILE_VERSION }}
116+
helm-version: ${{ env.HELM_VERSION }}
117+
helmfile-args: sync --wait
118+
119+
- name: Test the db-operator chart upgrade
120+
run: |
121+
ct install --target-branch main --charts ./charts/db-operator --upgrade
122+
helmfile destroy
123+
124+
- uses: helmfile/helmfile-action@v1.0.0
125+
with:
126+
helmfile-version: ${{ env.HELMFILE_VERSION }}
127+
helm-version: ${{ env.HELM_VERSION }}
128+
helmfile-args: sync -e instances --wait
129+
114130
- name: Test db-instances charts install
115131
run: |
116-
helmfile -l name=prometheus-stack sync
117-
helmfile sync -e instances
118-
kubectl rollout status deploy/db-operator -n db-operator
119-
kubectl rollout status deploy/db-operator-webhook -n db-operator
120132
ct install --target-branch main --charts ./charts/db-instances
121133
helmfile destroy
122-
- name: Test db-instances charts install
134+
135+
- uses: helmfile/helmfile-action@v1.0.0
136+
with:
137+
helmfile-version: ${{ env.HELMFILE_VERSION }}
138+
helm-version: ${{ env.HELM_VERSION }}
139+
helmfile-args: sync -e instances --wait
140+
141+
- name: Test db-instances charts upgrade
123142
run: |
124-
helmfile -l name=prometheus-stack sync
125-
helmfile sync -e instances
126-
kubectl rollout status deploy/db-operator -n db-operator
127-
kubectl rollout status deploy/db-operator-webhook -n db-operator
128143
ct install --target-branch main --charts ./charts/db-instances --upgrade
129144
helmfile destroy
130145
release:

helmfile.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ releases:
1515
- name: cert-manager
1616
chart: jetstack/cert-manager
1717
namespace: cert-manager
18+
version: v1.16.1
1819
createNamespace: true
1920
values:
20-
- installCRDs: true
21+
- crds:
22+
enabled: true
2123

2224
- name: postgres-instance
2325
namespace: databases
2426
chart: bitnami/postgresql
27+
version: 16.0.6
2528
values:
2629
- global:
2730
postgresql:
@@ -31,17 +34,21 @@ releases:
3134
- name: mysql-instance
3235
namespace: databases
3336
chart: bitnami/mysql
37+
version: 11.1.19
3438
values:
3539
- auth:
3640
rootPassword: 123123!!
3741
password: 123123!!
3842

3943
- name: prometheus-stack
4044
namespace: monitoring
45+
version: 65.3.2
4146
createNamespace: true
4247
disableValidation: true
4348
disableOpenAPIValidation: true
4449
chart: prometheus-community/kube-prometheus-stack
50+
needs:
51+
- cert-manager/cert-manager
4552
values:
4653
- prometheus:
4754
prometheusSpec:
@@ -62,8 +69,9 @@ releases:
6269
- name: db-operator
6370
namespace: db-operator
6471
createNamespace: true
65-
needs:
66-
- cert-manager/cert-manager
6772
installed: {{ eq .Environment.Name "instances" | toYaml }}
6873
chart: ./charts/db-operator
74+
needs:
75+
- monitoring/prometheus-stack
76+
- cert-manager/cert-manager
6977

0 commit comments

Comments
 (0)