-
Notifications
You must be signed in to change notification settings - Fork 3
82 lines (78 loc) · 2.28 KB
/
lint-test.yaml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Lint and test charts
on: pull_request
jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Helm
run: |
cd /tmp
curl -fsSLo get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Generate helm templates
run: |
cd charts
for chart in *; do
helm dependency build $chart
mkdir -p /tmp/charts/$chart
helm template $chart $chart \
--values $chart/ci/linter-values.yaml \
--output-dir /tmp/charts/$chart
done
- name: Install YAMLlint
run: sudo apt-get -y install yamllint
- name: Lint the templates
run: |
set -euo pipefail
cat > .yamllint <<EOF
extends: default
rules:
indentation:
indent-sequences: consistent
line-length:
level: warning
EOF
yamllint -f parsable /tmp/charts | awk -F: '{print; system("sed \"" $2 "q;d\" " $1)}'
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Set up chart-testing dependencies
run: sudo apt-get -y install python3-wheel
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ./default.ct.yaml)
if [[ "$changed" ]]; then
echo "::set-output name=changed::true"
echo "$changed"
fi
- name: Run chart-testing (lint)
run: ct lint --config ./default.ct.yaml
- name: Create kind cluster
uses: helm/[email protected]
with:
version: v0.14.0
node_image: kindest/node:v1.23.6
if: steps.list-changed.outputs.changed == 'true'
- name: Run chart-testing (install)
run: ct install --config ./default.ct.yaml
linter-artifacthub:
runs-on: ubuntu-latest
container:
image: artifacthub/ah
options: --user root
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run ah lint
working-directory: ./charts/
run: ah lint