Skip to content

Commit

Permalink
ci: Add diff pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke committed Jul 21, 2024
1 parent ff28023 commit d2cf421
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: |
changed=$(ct list-changed --config charts/ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
Expand All @@ -34,3 +34,49 @@ jobs:

- name: Run chart-testing (install)
run: ct install --debug --config charts/ct.yaml --excluded-charts amazon-eks-pod-identity-webhook,keycloak-config-cli
diff:
name: check diff
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config charts/ct.yaml)
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "changed_list=\"${changed//$'\n'/ }\"" >> "$GITHUB_OUTPUT"
fi
- name: install helm diff plugin
if: steps.list-changed.outputs.changed == 'true'
run: |
helm env
helm plugin install https://github.com/databus23/helm-diff --version 3.9.9
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]

- name: Run chart-testing (diff)
if: steps.list-changed.outputs.changed == 'true'
run: |
changed_list=$(echo $changed_list)
for chart in $changed_list; do
helm install $chart oci://ghcr.io/${{ github.repository_owner }}/charts/$chart --create-namespace --namespace $chart --wait
helm diff upgrade $chart charts/$chart \
--namespace $chart \
--suppress=CustomResourceDefinition \
--normalize-manifests \
--reset-values \
--suppress-output-line-regex="chart: [0-9]" \
--suppress-output-line-regex="app.kubernetes.io/version: [0-9]"
done

0 comments on commit d2cf421

Please sign in to comment.