feat(argo-cd): adds toggle for helm-working-dir #4155
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Reference: https://github.com/helm/chart-testing-action | |
name: Linting and Testing | |
on: pull_request | |
permissions: | |
contents: read | |
jobs: | |
linter-artifacthub: | |
runs-on: ubuntu-latest | |
container: | |
image: public.ecr.aws/artifacthub/ah:v1.14.0 | |
options: --user 1001 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
- name: Run ah lint | |
working-directory: ./charts | |
run: ah lint | |
chart-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
with: | |
fetch-depth: 0 | |
- name: Set up Helm | |
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 | |
with: | |
version: v3.10.1 # Also update in publish.yaml | |
- name: Set up python | |
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 | |
with: | |
python-version: 3.9 | |
- name: Setup Chart Linting | |
id: lint | |
uses: helm/chart-testing-action@e8788873172cb653a90ca2e819d79d65a66d4e76 # v2.4.0 | |
with: | |
# Note: Also update in scripts/lint.sh | |
version: v3.7.1 | |
- name: List changed charts | |
id: list-changed | |
run: | | |
## If executed with debug this won't work anymore. | |
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 --lint-conf ./.github/configs/lintconf.yaml | |
- name: Run docs-testing (helm-docs) | |
id: helm-docs | |
run: | | |
./scripts/helm-docs.sh | |
if [[ $(git diff --stat) != '' ]]; then | |
echo -e '\033[0;31mDocumentation outdated!\033[0m ❌' | |
git diff --color | |
exit 1 | |
else | |
echo -e '\033[0;32mDocumentation up to date\033[0m ✔' | |
fi | |
- name: Create kind cluster | |
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0 | |
if: steps.list-changed.outputs.changed == 'true' | |
with: | |
config: .github/configs/kind-config.yaml | |
- name: Deploy latest ArgoCD CRDs when testing ArgoCD extensions | |
if: | | |
contains(steps.list-changed.outputs.changed_charts, 'argocd-image-updater') || | |
contains(steps.list-changed.outputs.changed_charts, 'argocd-apps') | |
run: | | |
helm repo add dandydeveloper https://dandydeveloper.github.io/charts/ | |
helm dependency build charts/argo-cd/ | |
helm template charts/argo-cd/ --set server.extensions.enabled=true -s templates/crds/* | kubectl apply -f - | |
- name: Skip HPA tests of ArgoCD | |
if: contains(steps.list-changed.outputs.changed_charts, 'argo-cd') | |
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 | |
if: steps.list-changed.outputs.changed == 'true' |