Skip to content

Commit

Permalink
HDDS-11834. Test chart on push events (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
adoroszlai authored Dec 2, 2024
1 parent 14c4351 commit 5b5e67b
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Test Charts

on: pull_request
on:
pull_request:
types: [opened, synchronize]
push:

jobs:
test:
Expand All @@ -24,22 +27,27 @@ jobs:
- name: Set up chart-testing
uses: ./.github/actions/chart-testing-action

- name: Run chart-testing (list-changed)
id: list-changed
- name: Find changes (PR)
if: github.event_name == 'pull_request'
run: |
changed=$(ct list-changed --target-branch ${{ github.base_ref }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "test_scope=--target-branch ${{ github.base_ref }}" >> "$GITHUB_ENV"
fi
- name: Find changes (push)
if: github.event_name != 'pull_request'
run: |
echo "test_scope=--all" >> "$GITHUB_ENV"
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.base_ref }} --validate-maintainers=false --check-version-increment=false
if: env.test_scope != ''
run: ct lint ${{ env.test_scope }} --validate-maintainers=false --check-version-increment=false

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
if: env.test_scope != ''
uses: ./.github/actions/kind-action

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.base_ref }}
if: env.test_scope != ''
run: ct install ${{ env.test_scope }}

0 comments on commit 5b5e67b

Please sign in to comment.