-
Notifications
You must be signed in to change notification settings - Fork 58
59 lines (48 loc) · 1.63 KB
/
lint-charts.yaml
File metadata and controls
59 lines (48 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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/[email protected]
- 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/[email protected]
- name: Run chart-testing (install)
run: ct install --target-branch ${{ github.event.repository.default_branch }} --helm-extra-set-args "--set=accelerator.type=cpu"