Skip to content

Commit

Permalink
Add linting job
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Franssen <[email protected]>
  • Loading branch information
marcofranssen committed Jan 2, 2023
1 parent 0832f33 commit 6408c7f
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,49 @@ name: Test Charts
on:
pull_request:
paths:
- ".github/workflows/test.yml"
- "charts/**"

jobs:
build-matrix:
name: Find charts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # pin@v3
with:
fetch-depth: 0

- name: Find charts
id: build-matrix
run: |
charts=$(find charts -type f -name 'Chart.yaml' | sed -r 's|/[^/]+$||' | sort | uniq | jq -c --slurp --raw-input 'split("\n") | map(select(. != ""))')
echo "charts=$charts" >> $GITHUB_OUTPUT
outputs:
charts: ${{ steps.build-matrix.outputs.charts }}

lint:
runs-on: ubuntu-latest
needs: [build-matrix]

strategy:
fail-fast: true
matrix:
chart: ${{ fromJson(needs.build-matrix.outputs.charts) }}

steps:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # pin@v3
with:
fetch-depth: 0

- name: Check lock file updated
run: |
helm dependency update . && helm dependency build .
git diff --exit-code
working-directory: ${{ matrix.chart }}

test:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 6408c7f

Please sign in to comment.