-
Notifications
You must be signed in to change notification settings - Fork 51
93 lines (76 loc) · 2.41 KB
/
lint-test.yml
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
89
90
91
92
93
name: Lint and Test Charts
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
changes:
outputs:
charts: ${{ steps.filter.outputs.charts }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- id: filter
uses: dorny/paths-filter@v3.0.2
with:
filters: |
charts:
- 'charts/**/Chart.yaml'
- 'charts/**/*'
token: ${{ secrets.GITHUB_TOKEN }}
lint-test:
if: needs.changes.outputs.charts == 'true'
runs-on: ubuntu-latest
needs:
- changes
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch history
run: git fetch --prune --unshallow
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.7.2
- uses: actions/setup-python@v5
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ./.github/ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --config ./.github/ct.yaml
- name: Create kind cluster
uses: helm/kind-action@v1.10.0
if: steps.list-changed.outputs.changed == 'true'
- name: Add bitnami chart repos
run: helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Add dragonfly chart repos
run: helm repo add dragonfly https://dragonflyoss.github.io/helm-charts/
- name: Add nydus-snapshotter chart repos
run: helm repo add nydus-snapshotter https://dragonflyoss.github.io/helm-charts/
- name: Run chart-testing (install)
run: ct install --config ./.github/ct.yaml
docs-validate:
if: needs.changes.outputs.charts == 'true'
needs:
- changes
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check for changes
run: |
docker run --rm --volume "$(pwd):/helm-docs" -u "$(id -u)" jnorwood/helm-docs:v1.10.0
if ! git diff --exit-code; then
echo "Documentation not up to date. Please run helm-docs and commit changes!" >&2
exit 1
fi