-
Notifications
You must be signed in to change notification settings - Fork 1.9k
73 lines (62 loc) · 2.17 KB
/
lint-test-chart.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
name: Lint and Test Chart
on:
pull_request:
paths:
- .github/workflows/lint-test-chart.yaml
- "charts/metrics-server/**"
jobs:
lint-test:
name: Lint & Test
if: github.repository == 'kubernetes-sigs/metrics-server'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3
with:
fetch-depth: 0
- name: Set-up Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: "3.x"
- name: Set-up Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
- name: Set-up Artifact Hub CLI
run: |
set -euo pipefail
curl -Lo /tmp/ah.tar.gz https://github.com/artifacthub/hub/releases/download/v1.11.0/ah_1.11.0_linux_amd64.tar.gz
tar -xzvf /tmp/ah.tar.gz --directory /tmp
mv /tmp/ah /usr/local/bin/ah
chmod +x /usr/local/bin/ah
rm -f /tmp/ah.tar.gz
- name: Set-up chart-testing
uses: helm/chart-testing-action@e8788873172cb653a90ca2e819d79d65a66d4e76 # v2.4.0
- name: Check for changes
id: changes
run: |
changed="$(ct list-changed)"
if [[ -n "${changed}" ]]
then
echo "changed=${{ toJSON(true) }}" >> $GITHUB_OUTPUT
else
echo "changed=${{ toJSON(false) }}" >> $GITHUB_OUTPUT
fi
- name: Run Artifact Hub lint
if: fromJSON(steps.changes.outputs.changed)
run: ah lint --kind helm || exit 1
- name: Run chart-testing lint
if: fromJSON(steps.changes.outputs.changed)
run: ct lint --check-version-increment=false
- name: Create Kind cluster
if: fromJSON(steps.changes.outputs.changed)
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
with:
wait: 120s
- name: Run chart-testing install
if: fromJSON(steps.changes.outputs.changed)
run: ct install