From e25c3467ada65ab2ff17ce6cdaa47559fb6c0006 Mon Sep 17 00:00:00 2001 From: PSanetra Date: Fri, 9 Aug 2024 13:04:23 +0200 Subject: [PATCH] test(chart): Add minimal integration test using kind and ct --- .github/workflows/publish-helm-chart.yaml | 28 +++++++++++++++++++++++ chart/ci/ct-values.yaml | 6 +++++ chart/ci/ct.yaml | 4 ++++ 3 files changed, 38 insertions(+) create mode 100644 chart/ci/ct-values.yaml create mode 100644 chart/ci/ct.yaml diff --git a/.github/workflows/publish-helm-chart.yaml b/.github/workflows/publish-helm-chart.yaml index 22a8c70..6b94dce 100644 --- a/.github/workflows/publish-helm-chart.yaml +++ b/.github/workflows/publish-helm-chart.yaml @@ -29,6 +29,34 @@ jobs: - name: Run Helm Unit Tests run: helm unittest chart --strict + - name: Create kind cluster + uses: helm/kind-action@v1 + with: + cluster_name: kind + + - uses: docker/build-push-action@v6 + name: Build current image as base for Angular example + with: + context: . + push: false + pull: true + tags: "codecentric/single-page-application-server:1-nginx-stable-alpine" + build-args: NGINX_TAG=stable-alpine + + - uses: docker/build-push-action@v6 + name: Build Angular example image + with: + context: examples/angular + push: false + pull: false + tags: "angular-example:latest" + + - name: Copy image to kind node + run: kind load docker-image "angular-example:latest" + + - name: Run chart-testing in kind + run: ct install --config chart/ci/ct.yaml + - name: Package Helm Chart run: helm package chart -u --version ${{ steps.get_latest_version.outputs.version }} --destination . diff --git a/chart/ci/ct-values.yaml b/chart/ci/ct-values.yaml new file mode 100644 index 0000000..b7ba722 --- /dev/null +++ b/chart/ci/ct-values.yaml @@ -0,0 +1,6 @@ +pod: + container: + image: + repository: angular-example + tag: latest + pullPolicy: IfNotPresent diff --git a/chart/ci/ct.yaml b/chart/ci/ct.yaml new file mode 100644 index 0000000..ef758e6 --- /dev/null +++ b/chart/ci/ct.yaml @@ -0,0 +1,4 @@ +charts: "chart" +validate-maintainers: true +validate-yaml: true +debug: true