From 589a6ffd00d3a0aac58285c67a64e63114153f7f Mon Sep 17 00:00:00 2001 From: Philipp B Date: Thu, 29 Dec 2022 17:22:09 +0100 Subject: [PATCH] feat(ci test): add testing for helm chart (#622) feat: add lint-test-chart job to CI Signed-off-by: Philipp Born Signed-off-by: Philipp Born --- .ct.yaml | 8 +++++++ .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .ct.yaml diff --git a/.ct.yaml b/.ct.yaml new file mode 100644 index 000000000000..7b7f7bed820e --- /dev/null +++ b/.ct.yaml @@ -0,0 +1,8 @@ +# See https://github.com/helm/chart-testing#configuration +remote: origin +target-branch: main +chart-dirs: + - contrib/charts +helm-extra-args: --debug --timeout 60s +check-version-increment: false +validate-maintainers: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45385792989c..0204b7a70712 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,3 +80,49 @@ jobs: GLOG_logtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 ctest -V -L DFLY ./dragonfly_test --mem_defrag_threshold=0.05 # trying to catch issue with defrag # GLOG_logtostderr=1 GLOG_vmodule=transaction=1,engine_shard_set=1 CTEST_OUTPUT_ON_FAILURE=1 ninja server/test + lint-test-chart: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v3 + + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + check-latest: true + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.3.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --config .ct.yaml) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Run chart-testing (lint) + run: | + ct \ + lint \ + --config .ct.yaml \ + ${{github.event_name == 'workflow_dispatch' && '--all'}} ; + + - if: steps.list-changed.outputs.changed == 'true' || github.event_name == 'workflow_dispatch' + name: Create kind cluster + uses: helm/kind-action@v1.5.0 + + - name: Run chart-testing (install) + run: | + ct \ + install \ + --config .ct.yaml \ + --debug \ + --helm-extra-set-args "--set=image.repository=ghcr.io/${{ github.repository }}" \ + ${{github.event_name == 'workflow_dispatch' && '--all'}} ;