Skip to content
Permalink
Browse files
make ci lint/install run based on paths
Instead of using chart-releaser heuristics, use GitHub actions to trigger the action. This cuts down on GitHub Action churn to "check for changes" and ensures tests run when action definitions change. This is particularly efficient because there is only one chart in this repository (i.e. no benefits gained from chart-releaser being selective)
  • Loading branch information
colearendt committed Jun 18, 2022
1 parent 34004d9 commit d1939f6a1be3b44f049da531a43776f5b21d6d2e
Showing 1 changed file with 5 additions and 28 deletions.
@@ -5,6 +5,10 @@ on:
branches:
- main
pull_request:
paths:
- '.github/workflows/chart-test.yaml'
- '.github/actions/**'
- 'couchdb/**'

permissions:
checks: write
@@ -30,20 +34,7 @@ jobs:
- name: Set up chart-testing
uses: ./.github/actions/chart-testing-action

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch main --chart-dirs .)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint changed)
if: ${{ github.ref != 'refs/heads/main' }}
run: ct lint --target-branch main --chart-dirs .

- name: Run chart-testing (lint all)
if: ${{ github.ref == 'refs/heads/main' }}
run: ct lint --target-branch main --all --chart-dirs .

install:
@@ -64,22 +55,8 @@ jobs:
- name: Set up chart-testing
uses: ./.github/actions/chart-testing-action

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch main --chart-dirs .)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Create kind cluster
uses: ./.github/actions/kind-action
if: ( steps.list-changed.outputs.changed == 'true' ) || ${{ github.ref == 'refs/heads/main' }}

- name: Run chart-testing (install changed)
if: ${{ github.ref != 'refs/heads/main' }}
run: ct install --target-branch main --chart-dirs --upgrade .

- name: Run chart-testing (install all)
if: ${{ github.ref == 'refs/heads/main' }}
run: ct install --target-branch main --all --chart-dirs --upgrade .
run: ct install --target-branch main --all --upgrade --chart-dirs .

0 comments on commit d1939f6

Please sign in to comment.