1- # # Reference: https://github.com/helm/chart-testing-action
2- name : Linting and Testing
3- on : pull_request
1+ name : Chart Publish
2+ on :
3+ push :
4+ branches :
5+ - argo-workflows
46
57permissions :
68 contents : read
79
810jobs :
9- chart-test :
11+ publish :
12+ permissions :
13+ contents : write # for helm/chart-releaser-action to push chart release and create a release
1014 runs-on : ubuntu-latest
1115 steps :
1216 - name : Checkout
1317 uses : actions/checkout@v3
1418 with :
1519 fetch-depth : 0
1620
17- - name : Set up Helm
21+ - name : Install Helm
1822 uses : azure/setup-helm@v3
1923 with :
20- version : v3.10.1 # Also update in publish .yaml
24+ version : v3.10.1 # Also update in lint-and-test .yaml
2125
22- - name : Set up python
23- uses : actions/setup-python@v4
24- with :
25- python-version : 3.9
26-
27- - name : Setup Chart Linting
28- id : lint
29- 30- with :
31- # Note: Also update in scripts/lint.sh
32- version : v3.7.1
33-
34- - name : List changed charts
35- id : list-changed
36- run : |
37- ## If executed with debug this won't work anymore.
38- changed=$(ct --config ./.github/configs/ct-lint.yaml list-changed)
39- charts=$(echo "$changed" | tr '\n' ' ' | xargs)
40- if [[ -n "$changed" ]]; then
41- echo "::set-output name=changed::true"
42- echo "::set-output name=changed_charts::$charts"
43- fi
44-
45- - name : Run chart-testing (lint)
46- run : ct lint --debug --config ./.github/configs/ct-lint.yaml --lint-conf ./.github/configs/lintconf.yaml
47-
48- - name : Run docs-testing (helm-docs)
49- id : helm-docs
50- run : |
51- ./scripts/helm-docs.sh
52- if [[ $(git diff --stat) != '' ]]; then
53- echo -e '\033[0;31mDocumentation outdated!\033[0m ❌'
54- git diff --color
55- exit 1
56- else
57- echo -e '\033[0;32mDocumentation up to date\033[0m ✔'
58- fi
59-
60- - name : Create kind cluster
61- 62- if : steps.list-changed.outputs.changed == 'true'
63- with :
64- config : .github/configs/kind-config.yaml
65-
66- - name : Deploy latest ArgoCD CRDs when testing ArgoCD extensions
67- if : |
68- contains(steps.list-changed.outputs.changed_charts, 'argocd-image-updater') ||
69- contains(steps.list-changed.outputs.changed_charts, 'argocd-apps')
26+ - name : Add dependency chart repos
7027 run : |
7128 helm repo add dandydeveloper https://dandydeveloper.github.io/charts/
72- helm dependency build charts/argo-cd/
73- helm template charts/argo-cd/ --set server.extensions.enabled=true -s templates/crds/* | kubectl apply -f -
74-
75- - name : Skip HPA tests of ArgoCD
76- if : contains(steps.list-changed.outputs.changed_charts, 'argo-cd')
29+ - name : Configure Git
7730 run : |
78- ## Metrics API not available in kind cluster
79- rm charts/argo-cd/ci/ha-autoscaling-values.yaml
80-
81- - name : Create an external redis for ArgoCD externalRedis feature
82- if : contains(steps.list-changed.outputs.changed_charts, 'argo-cd')
31+ git config user.name "$GITHUB_ACTOR"
32+ git config user.email "[email protected] " 33+ - name : Package chart
8334 run : |
84- kubectl create namespace redis
85- helm repo add bitnami https://charts.bitnami.com/bitnami
86- helm install redis bitnami/redis --wait --namespace redis --set auth.password=argocd --set architecture=standalone
87-
88- - name : Run chart-testing (install)
89- run : ct install --config ./.github/configs/ct-install.yaml
90- if : steps.list-changed.outputs.changed == 'true'
35+ rm -rf .cr-release-packages
36+ mkdir .cr-release-packages
37+ helm package charts/argo-workflows -u -d .cr-release-packages/
38+
39+ - name : Run chart-releaser
40+ uses : helm/chart-releaser-action@main
41+ with :
42+ config : " ./.github/configs/cr.yaml"
43+ skip_packaging : true
44+ env :
45+ CR_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
0 commit comments