-
Notifications
You must be signed in to change notification settings - Fork 45
88 lines (69 loc) · 2.3 KB
/
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
83
84
85
86
87
88
name: Lint and Test Charts
on:
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.14.0
- name: install helm unittest
run: |
helm env
helm plugin install https://github.com/helm-unittest/helm-unittest
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Setup environment for pre-commit
run: hack/ci/github/setup/pre-commit.sh
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: |
pre-commit run --show-diff-on-failure --color=always --files $(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)
lint-test:
name: Lint and Install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.14.0
- name: install helm unittest
run: |
helm env
helm plugin install https://github.com/helm-unittest/helm-unittest
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install chart-testing
uses: helm/[email protected]
- name: Install Artifact Hub CLI tool
run: hack/sh/deps/ah.sh
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct --config=hack/chart-testing/ct.yaml list-changed)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing (lint)
run: ct --config=hack/chart-testing/ct.yaml lint
- name: Create kind cluster
uses: helm/[email protected]
if: steps.list-changed.outputs.changed == 'true'
- name: Setup cluster for chart-testing (install)
run: hack/deploy/init.sh
if: steps.list-changed.outputs.changed == 'true'
- name: Run chart-testing (install)
run: ct --config=hack/chart-testing/ct-install.yaml install