Fixes failing CI on pre-commit and lint #620
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint and Test Charts | |
| on: pull_request | |
| jobs: | |
| detect-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changed: ${{ steps.check.outputs.changed }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for chart changes | |
| id: check | |
| run: | | |
| if git diff --name-only origin/${{ github.event.repository.default_branch }}...HEAD | grep -q '^charts/'; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| lint-test: | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.changed == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v5 | |
| with: | |
| version: v3.17.0 | |
| - name: Set up chart-testing | |
| uses: helm/chart-testing-action@v2.8.0 | |
| - name: Add Helm dependency repos | |
| run: | | |
| for dir in $(ls -d charts/*/); do | |
| helm dependency list --max-col-width 120 $dir 2> /dev/null | tail +2 | head -n -1 | awk '{ print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done | |
| done | |
| - name: Run make lint | |
| env: | |
| TARGET_BRANCH: ${{ github.event.repository.default_branch }} | |
| run: make lint | |
| - name: Run make verify | |
| run: make verify | |
| - name: Create kind cluster | |
| uses: helm/kind-action@v1.14.0 | |
| - name: Run chart-testing (install) | |
| run: ct install --target-branch ${{ github.event.repository.default_branch }} --helm-extra-set-args "--set=accelerator.type=cpu" |