|
56 | 56 | if: steps.list-changed.outputs.changed == 'true' |
57 | 57 | run: ct lint --target-branch ${{ github.event.repository.default_branch }} |
58 | 58 |
|
59 | | - run-tests: |
| 59 | + test: |
60 | 60 | runs-on: ubuntu-22.04 |
61 | 61 | needs: [changes, lint] |
62 | 62 | # only run this job if there are helm chart file changes |
|
82 | 82 | - name: Horizontal Pod Autoscaling Enabled |
83 | 83 | helm_args: '--helm-extra-set-args "--set=hpa.enabled=true --set=hpa.minPods=2 --set=hpa.maxPods=3 --set=hpa.targetCPUUtilizationPercentage=75"' |
84 | 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 | +
|
85 | 91 | steps: |
86 | 92 | - name: Checkout |
87 | 93 | uses: actions/checkout@v4 |
@@ -112,15 +118,43 @@ jobs: |
112 | 118 | |
113 | 119 | if: steps.list-changed.outputs.changed == 'true' |
114 | 120 |
|
| 121 | + - name: Install MinIO for testing S3 as Primary Storage |
| 122 | + if: matrix.test_cases.name == 'S3 Enabled as Primary Storage' |
| 123 | + # installs minio community helm chart here: |
| 124 | + # https://github.com/minio/minio/tree/master/helm/minio |
| 125 | + run: | |
| 126 | + helm repo add minio https://charts.min.io/ && \ |
| 127 | + helm install minio \ |
| 128 | + --namespace nextcloud \ |
| 129 | + --create-namespace \ |
| 130 | + --wait \ |
| 131 | + --wait-for-jobs \ |
| 132 | + --timeout 2m0s \ |
| 133 | + --values .github/minio_test_values.yaml \ |
| 134 | + minio/minio |
| 135 | +
|
115 | 136 | - name: Run chart-testing (install ${{ matrix.test_cases.name }}) |
116 | 137 | id: install |
117 | 138 | if: steps.list-changed.outputs.changed == 'true' |
118 | 139 | run: ct install --target-branch ${{ github.event.repository.default_branch }} ${{ matrix.test_cases.helm_args }} |
119 | 140 |
|
| 141 | + - name: Try adding a file to Nextcloud |
| 142 | + if: matrix.test_cases.name == 'S3 Enabled as Primary Storage' |
| 143 | + # applies a kubernetes job that uploads a file and then checks log of finished pod |
| 144 | + run: | |
| 145 | + kubectl config set-context --current --namespace=nextcloud && \ |
| 146 | + kubectl apply -f ./.github/test_upload_job.yaml --wait=true && \ |
| 147 | + sleep 2 && \ |
| 148 | + kubectl wait --for=condition=Complete --timeout=2m job/create-nextcloud-file && \ |
| 149 | + echo "Here's the logs from the job:" && \ |
| 150 | + kubectl logs --tail=-1 -f -l batch.kubernetes.io/job-name=create-nextcloud-file && \ |
| 151 | + echo "Here's the logs from the nextcloud pod:" && \ |
| 152 | + kubectl logs -l app.kubernetes.io/name=nextcloud |
| 153 | +
|
120 | 154 | summary: |
121 | 155 | runs-on: ubuntu-latest-low |
122 | | - needs: [changes, run-tests] |
| 156 | + needs: [changes, test] |
123 | 157 | if: always() |
124 | 158 | steps: |
125 | 159 | - name: Summary |
126 | | - run: if ${{ needs.changes.outputs.src != 'false' && needs.run-tests.result != 'success' }}; then exit 1; fi |
| 160 | + run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi |
0 commit comments