diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 43e21cf86..95a102264 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -1,5 +1,5 @@ +## Reference: https://github.com/helm/chart-testing-action name: Linting and Testing - on: pull_request permissions: @@ -47,14 +47,15 @@ jobs: id: list-changed run: | ## If executed with debug this won't work anymore. - changed=$(ct --config ./.github/configs/ct-lint.yaml --target-branch ${{ github.base_ref }} list-changed) + changed=$(ct --config ./.github/configs/ct-lint.yaml list-changed) charts=$(echo "$changed" | tr '\n' ' ' | xargs) if [[ -n "$changed" ]]; then echo "changed=true" >> $GITHUB_OUTPUT echo "changed_charts=$charts" >> $GITHUB_OUTPUT fi + - name: Run chart-testing (lint) - run: ct lint --debug --config ./.github/configs/ct-lint.yaml --target-branch ${{ github.base_ref }} --lint-conf ./.github/configs/lintconf.yaml + run: ct lint --debug --config ./.github/configs/ct-lint.yaml --lint-conf ./.github/configs/lintconf.yaml - name: Run docs-testing (helm-docs) id: helm-docs @@ -67,6 +68,7 @@ jobs: else echo -e '\033[0;32mDocumentation up to date\033[0m ✔' fi + - name: Create kind cluster uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0 if: steps.list-changed.outputs.changed == 'true' @@ -87,12 +89,14 @@ jobs: run: | ## Metrics API not available in kind cluster rm charts/argo-cd/ci/ha-autoscaling-values.yaml + - name: Create an external redis for ArgoCD externalRedis feature if: contains(steps.list-changed.outputs.changed_charts, 'argo-cd') run: | kubectl create namespace redis helm repo add bitnami https://charts.bitnami.com/bitnami helm install redis bitnami/redis --wait --namespace redis --set auth.password=argocd --set architecture=standalone + - name: Run chart-testing (install) - run: ct install --config ./.github/configs/ct-install.yaml --target-branch ${{ github.base_ref }} + run: ct install --config ./.github/configs/ct-install.yaml if: steps.list-changed.outputs.changed == 'true'