Skip to content

Commit 278f42d

Browse files
committed
fix(ci): use default chart-testing logic for different testcases
Signed-off-by: WrenIX <dev.github@wrenix.eu>
1 parent dff8e46 commit 278f42d

7 files changed

Lines changed: 48 additions & 101 deletions

File tree

.github/workflows/lint-test.yaml

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -61,33 +61,6 @@ jobs:
6161
needs: [changes, lint]
6262
# only run this job if there are helm chart file changes
6363
if: needs.changes.outputs.src != 'false'
64-
strategy:
65-
# continue with all the other jobs even if one fails
66-
fail-fast: false
67-
matrix:
68-
# each item in this list is a job with an isolated test VM
69-
test_cases:
70-
# test the plain helm chart with nothing changed
71-
- name: 'Default - no custom values'
72-
73-
# test the helm chart with postgresql subchart enabled
74-
- name: PostgreSQL Enabled
75-
helm_args: '--helm-extra-set-args "--set=postgresql.enabled=true --set=postgresql.global.postgresql.auth.password=testing123456 --set=internalDatabase.enabled=false --set=externalDatabase.enabled=True --set=externalDatabase.type=postgresql --set=externalDatabase.password=testing12345"'
76-
77-
# test the helm chart with nginx container enabled
78-
- name: Nginx Enabled
79-
helm_args: '--helm-extra-set-args "--set=image.flavor=fpm --set=nginx.enabled=true"'
80-
81-
# test the helm chart with horizontal pod autoscaling enabled
82-
- name: Horizontal Pod Autoscaling Enabled
83-
helm_args: '--helm-extra-set-args "--set=hpa.enabled=true --set=hpa.minPods=2 --set=hpa.maxPods=3 --set=hpa.targetCPUUtilizationPercentage=75"'
84-
85-
# test the helm chart with s3 as the primary storage
86-
- name: S3 Enabled as Primary Storage
87-
# we need to skip the clean up so we can test adding a file
88-
helm_args: |
89-
--namespace nextcloud --skip-clean-up --helm-extra-set-args "--set=fullnameOverride=nextcloud --set=nextcloud.objectStore.s3.enabled=true --set=nextcloud.objectStore.s3.accessKey=nextcloud --set=nextcloud.objectStore.s3.secretKey=rootpass123 --set=nextcloud.objectStore.s3.host=minio.nextcloud.svc.cluster.local --set=nextcloud.objectStore.s3.port=9000 --set=nextcloud.objectStore.s3.ssl=false --set=nextcloud.objectStore.s3.bucket=nextcloud --set=nextcloud.objectStore.s3.usePathStyle=true --set=image.flavor=fpm --set=nginx.enabled=true --set=nextcloud.host=nextcloud --set=nextcloud.trustedDomains[0]='*'"
90-
9164
steps:
9265
- name: Checkout
9366
uses: actions/checkout@v4
@@ -119,7 +92,7 @@ jobs:
11992
if: steps.list-changed.outputs.changed == 'true'
12093

12194
- name: Install MinIO for testing S3 as Primary Storage
122-
if: matrix.test_cases.name == 'S3 Enabled as Primary Storage'
95+
# only used during ct-s3-as-primary-values.yaml
12396
# installs minio community helm chart here:
12497
# https://github.com/minio/minio/tree/master/helm/minio
12598
run: |
@@ -133,13 +106,13 @@ jobs:
133106
--values .github/tests/minio_test_values.yaml \
134107
minio/minio
135108
136-
- name: Run chart-testing (install ${{ matrix.test_cases.name }})
109+
- name: Run chart-testing (install all charts/nextcloud/ci/ct-*-values.yaml)
137110
id: install
138111
if: steps.list-changed.outputs.changed == 'true'
139-
run: ct install --target-branch ${{ github.event.repository.default_branch }} ${{ matrix.test_cases.helm_args }}
112+
run: ct install --target-branch ${{ github.event.repository.default_branch }}
140113

141114
- name: Try adding a file to Nextcloud
142-
if: matrix.test_cases.name == 'S3 Enabled as Primary Storage'
115+
# only used during ct-s3-as-primary-values.yaml
143116
# applies a kubernetes job that uploads a file and then checks log of finished pod
144117
run: |
145118
kubectl config set-context --current --namespace=nextcloud && \

charts/nextcloud/ci/ct-all-enabled-values.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
hpa:
2+
enabled: true
3+
minPods: 2
4+
maxPods: 3
5+
targetCPUUtilizationPercentage: 75
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
image:
2+
flavor: fpm
3+
4+
nginx:
5+
enabled: true
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
postgresql:
2+
enabled: true
3+
global:
4+
postgresql:
5+
auth:
6+
password: testing123456
7+
internalDatabase:
8+
enabled: false
9+
externalDatabase:
10+
enabled: true
11+
type: postgresql
12+
password: testing123456
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
fullnameOverride: nextcloud
2+
3+
nextcloud:
4+
trustedDomains:
5+
- '*'
6+
host: "nextcloud"
7+
objectStore:
8+
s3:
9+
enabled: true
10+
accessKey: nextcloud
11+
secretKey: rootpass123
12+
host: minio.nextcloud.svc.cluster.local
13+
port: 9000
14+
ssl: false
15+
bucket: nextcloud
16+
usePathStyle: true
17+
18+
image:
19+
flavor: fpm
20+
21+
nginx:
22+
enabled: true

charts/nextcloud/ci/ct-specials-values.yaml

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)