init pipelines for workflows
This commit is contained in:
parent
9922289239
commit
f73413561a
1 changed files with 26 additions and 71 deletions
95
.github/workflows/lint-and-test.yml
vendored
95
.github/workflows/lint-and-test.yml
vendored
|
@ -1,12 +1,16 @@
|
||||||
## Reference: https://github.com/helm/chart-testing-action
|
name: Chart Publish
|
||||||
name: Linting and Testing
|
on:
|
||||||
on: pull_request
|
push:
|
||||||
|
branches:
|
||||||
|
- argo-workflows
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
chart-test:
|
publish:
|
||||||
|
permissions:
|
||||||
|
contents: write # for helm/chart-releaser-action to push chart release and create a release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
@ -14,77 +18,28 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Helm
|
- name: Install Helm
|
||||||
uses: azure/setup-helm@v3
|
uses: azure/setup-helm@v3
|
||||||
with:
|
with:
|
||||||
version: v3.10.1 # Also update in publish.yaml
|
version: v3.10.1 # Also update in lint-and-test.yaml
|
||||||
|
|
||||||
- name: Set up python
|
- name: Add dependency chart repos
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: 3.9
|
|
||||||
|
|
||||||
- name: Setup Chart Linting
|
|
||||||
id: lint
|
|
||||||
uses: helm/chart-testing-action@v2.3.1
|
|
||||||
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 "::set-output name=changed::true"
|
|
||||||
echo "::set-output name=changed_charts::$charts"
|
|
||||||
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@v1.5.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: |
|
run: |
|
||||||
helm repo add dandydeveloper https://dandydeveloper.github.io/charts/
|
helm repo add dandydeveloper https://dandydeveloper.github.io/charts/
|
||||||
helm dependency build charts/argo-cd/
|
- name: Configure Git
|
||||||
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: |
|
run: |
|
||||||
## Metrics API not available in kind cluster
|
git config user.name "$GITHUB_ACTOR"
|
||||||
rm charts/argo-cd/ci/ha-autoscaling-values.yaml
|
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||||
|
- name: Package chart
|
||||||
- name: Create an external redis for ArgoCD externalRedis feature
|
|
||||||
if: contains(steps.list-changed.outputs.changed_charts, 'argo-cd')
|
|
||||||
run: |
|
run: |
|
||||||
kubectl create namespace redis
|
rm -rf .cr-release-packages
|
||||||
helm repo add bitnami https://charts.bitnami.com/bitnami
|
mkdir .cr-release-packages
|
||||||
helm install redis bitnami/redis --wait --namespace redis --set auth.password=argocd --set architecture=standalone
|
helm package charts/argo-workflows -u -d .cr-release-packages/
|
||||||
|
|
||||||
- name: Run chart-testing (install)
|
- name: Run chart-releaser
|
||||||
run: ct install --config ./.github/configs/ct-install.yaml
|
uses: helm/chart-releaser-action@main
|
||||||
if: steps.list-changed.outputs.changed == 'true'
|
with:
|
||||||
|
config: "./.github/configs/cr.yaml"
|
||||||
|
skip_packaging: true
|
||||||
|
env:
|
||||||
|
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
Loading…
Reference in a new issue