Skip to content

Commit

Permalink
Fix chart testing action
Browse files Browse the repository at this point in the history
  • Loading branch information
allanger committed Oct 27, 2024
1 parent 36f241a commit 91ba651
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 26 deletions.
62 changes: 39 additions & 23 deletions .github/workflows/helm-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ on:
branches:
- main
env:
HELM_VERSION: v3.12.1
HELM_VERSION: v3.15.4
HELMFILE_VERSION: v0.167.1
HELM_PLUGINS: >
PYTHON_VERSION: 3.9
jobs:
lint:
Expand Down Expand Up @@ -79,8 +81,6 @@ jobs:
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Setup helmfile
uses: mamezou-tech/[email protected]
- name: Prepare a config for the kind cluster
run: |
cat > kind-config.yaml <<EOF
Expand All @@ -97,34 +97,50 @@ jobs:
with:
node_image: kindest/node:${{ matrix.k8s_version }}
config: ./kind-config.yaml
- name: Test db-operator charts install

- uses: helmfile/[email protected]
with:
helmfile-version: ${{ env.HELMFILE_VERSION }}
helm-version: ${{ env.HELM_VERSION }}
helm-plugins: >
https://github.com/databus23/helm-diff, https://github.com/jkroepke/helm-secrets
helmfile-args: sync --wait

- name: Test the db-operator chart install
run: |
helmfile -l name=prometheus-stack sync
helmfile sync
ct install --target-branch main --charts ./charts/db-operator
helmfile destroy
# Test is broken because of the image in the previous version,
# so upgrate can't pass
#- name: Test db-operator charts upgrade
# run: |
# helmfile -l name=prometheus-stack sync
# helmfile sync
# ct install --target-branch main --charts ./charts/db-operator --upgrade
# helmfile destroy
- uses: helmfile/[email protected]
with:
helmfile-version: ${{ env.HELMFILE_VERSION }}
helm-version: ${{ env.HELM_VERSION }}
helmfile-args: sync --wait

- name: Test the db-operator chart upgrade
run: |
ct install --target-branch main --charts ./charts/db-operator --upgrade
helmfile destroy
- uses: helmfile/[email protected]
with:
helmfile-version: ${{ env.HELMFILE_VERSION }}
helm-version: ${{ env.HELM_VERSION }}
helmfile-args: sync --wait

- name: Test db-instances charts install
run: |
helmfile -l name=prometheus-stack sync
helmfile sync -e instances
kubectl rollout status deploy/db-operator -n db-operator
kubectl rollout status deploy/db-operator-webhook -n db-operator
ct install --target-branch main --charts ./charts/db-instances
helmfile destroy
- name: Test db-instances charts install
- uses: helmfile/[email protected]
with:
helmfile-version: ${{ env.HELMFILE_VERSION }}
helm-version: ${{ env.HELM_VERSION }}
helmfile-args: sync --wait

- name: Test db-instances charts upgrade
run: |
helmfile -l name=prometheus-stack sync
helmfile sync -e instances
kubectl rollout status deploy/db-operator -n db-operator
kubectl rollout status deploy/db-operator-webhook -n db-operator
ct install --target-branch main --charts ./charts/db-instances --upgrade
helmfile destroy
release:
Expand Down
14 changes: 11 additions & 3 deletions helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ releases:
- name: cert-manager
chart: jetstack/cert-manager
namespace: cert-manager
version: v1.16.1
createNamespace: true
values:
- installCRDs: true
- crds:
enabled: true

- name: postgres-instance
namespace: databases
chart: bitnami/postgresql
version: 16.0.6
values:
- global:
postgresql:
Expand All @@ -31,17 +34,21 @@ releases:
- name: mysql-instance
namespace: databases
chart: bitnami/mysql
version: 11.1.19
values:
- auth:
rootPassword: 123123!!
password: 123123!!

- name: prometheus-stack
namespace: monitoring
version: 65.3.2
createNamespace: true
disableValidation: true
disableOpenAPIValidation: true
chart: prometheus-community/kube-prometheus-stack
needs:
- cert-manager/cert-manager
values:
- prometheus:
prometheusSpec:
Expand All @@ -62,8 +69,9 @@ releases:
- name: db-operator
namespace: db-operator
createNamespace: true
needs:
- cert-manager/cert-manager
installed: {{ eq .Environment.Name "instances" | toYaml }}
chart: ./charts/db-operator
needs:
- monitoring/prometheus-stack
- cert-manager/cert-manager

0 comments on commit 91ba651

Please sign in to comment.