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 9cc2089
Showing 1 changed file with 51 additions and 1 deletion.
52 changes: 51 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,59 @@ 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: false
matrix:
chart: ${{ fromJson(needs.build-matrix.outputs.charts) }}

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

- name: Set up Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # [email protected]
with:
version: v3.10.3

- name: Setup Sigstore Helm repo
run: |
helm repo add sigstore https://sigstore.github.io/helm-charts
helm repo update
- 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 All @@ -17,7 +67,7 @@ jobs:
- name: Set up Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # [email protected]
with:
version: v3.10.0
version: v3.10.3

- uses: actions/setup-python@5ccb29d8773c3f3f653e1705f474dfaa8a06a912 # pin@v4
with:
Expand Down

0 comments on commit 9cc2089

Please sign in to comment.