Skip to content

Commit b1b40c5

Browse files
authored
chore: add linting step to validate any chart contributions (#43)
This PR includes the following GitHub actions for lining the chart: Here the official example: https://github.com/helm/charts-repo-actions-demo https://github.com/helm/chart-testing-action https://github.com/helm/kind-action What does it lint? * correct bump up (verify against the latest changes in chart repository) * validate yaml * trigger a local kubernetes to install the chart
1 parent 03431b7 commit b1b40c5

File tree

4 files changed

+67
-12
lines changed

4 files changed

+67
-12
lines changed

.github/workflows/lint-test.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Lint and Test Charts
2+
3+
on: pull_request
4+
5+
jobs:
6+
lint-test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Set up Helm
15+
uses: azure/setup-helm@v1
16+
with:
17+
version: v3.4.1
18+
19+
# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
20+
# yamllint (https://github.com/adrienverge/yamllint) which require Python
21+
- name: Set up Python
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: 3.7
25+
26+
- name: Set up chart-testing
27+
uses: helm/[email protected]
28+
with:
29+
version: v3.3.0
30+
31+
- name: Run chart-testing (list-changed)
32+
id: list-changed
33+
run: |
34+
changed=$(ct list-changed --config ct.yaml)
35+
if [[ -n "$changed" ]]; then
36+
echo "::set-output name=changed::true"
37+
fi
38+
39+
- name: Run chart-testing (lint)
40+
run: ct lint --config ct.yaml
41+
42+
- name: Create kind cluster
43+
uses: helm/[email protected]
44+
if: steps.list-changed.outputs.changed == 'true'
45+
46+
- name: Run chart-testing (install)
47+
run: ct install --config ct.yaml

charts/verdaccio/Chart.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
apiVersion: v1
22
description: A lightweight private npm proxy registry (sinopia fork)
33
name: verdaccio
4-
version: 0.16.3
4+
version: 0.16.4
55
appVersion: 4.7.2
66
home: https://verdaccio.org
77
icon: https://cdn.verdaccio.dev/logos/default.png
88
sources:
9-
- https://verdaccio.org
10-
- https://github.com/verdaccio/verdaccio
9+
- https://verdaccio.org
10+
- https://github.com/verdaccio/verdaccio
1111
keywords:
12-
- npm
13-
- nodejs
12+
- npm
13+
- nodejs
1414
maintainers:
15-
- name: juanpicado
16-
17-
- name: Jhon Mike
18-
15+
- name: juanpicado
16+
17+
- name: jhonmike
18+

charts/verdaccio/values.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ tolerations: []
3131
podAnnotations: {}
3232
replicaCount: 1
3333

34-
resources: {}
34+
resources:
35+
{}
3536
# limits:
3637
# cpu: 100m
3738
# memory: 512Mi
@@ -160,8 +161,8 @@ persistence:
160161
accessMode: ReadWriteOnce
161162
size: 8Gi
162163
volumes:
163-
# - name: nothing
164-
# emptyDir: {}
164+
# - name: nothing
165+
# emptyDir: {}
165166
mounts:
166167
# - mountPath: /var/nothing
167168
# name: nothing

ct.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See https://github.com/helm/chart-testing#configuration
2+
remote: origin
3+
chart-dirs:
4+
- charts
5+
chart-repos:
6+
- verdaccio=https://charts.verdaccio.org
7+
helm-extra-args: --timeout 600s

0 commit comments

Comments
 (0)