Skip to content

Commit 0c69eab

Browse files
authored
add testing (#2)
1 parent ded8893 commit 0c69eab

File tree

11 files changed

+189
-519
lines changed

11 files changed

+189
-519
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/pr.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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@v3
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Set up Helm
15+
uses: azure/setup-helm@v3
16+
with:
17+
version: v3.10.0
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
# token: ${{ secrets.PYTHON_API_TOKEN }}
23+
python-version: "3.10"
24+
check-latest: true
25+
26+
- name: Set up chart-testing
27+
uses: helm/chart-testing-action@v2.3.1
28+
with:
29+
version: v3.5.1
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 "$changed"
37+
echo "::set-output name=changed::true"
38+
fi
39+
- name: Run chart-testing (lint)
40+
run: ct lint --config ct.yaml --debug
41+
42+
# lint-test-install:
43+
# runs-on: ubuntu-latest
44+
# strategy:
45+
# matrix:
46+
# # https://kubernetes.io/releases/
47+
# k8s:
48+
# - v1.21.2
49+
# - v1.22.15
50+
# - v1.23.12
51+
# - v1.24.6
52+
# - v1.25.2
53+
# steps:
54+
# - name: Checkout
55+
# uses: actions/checkout@v3
56+
# with:
57+
# fetch-depth: 0
58+
59+
# - name: Set up chart-testing
60+
# uses: helm/chart-testing-action@v2.3.1
61+
# with:
62+
# version: v3.5.1
63+
64+
# - name: Run chart-testing (list-changed)
65+
# id: list-changed
66+
# run: |
67+
# changed=$(ct list-changed --config ct.yaml)
68+
# if [[ -n "$changed" ]]; then
69+
# echo "$changed"
70+
# echo "::set-output name=changed::true"
71+
# fi
72+
73+
# - name: Create kind cluster
74+
# if: steps.list-changed.outputs.changed == 'true'
75+
# uses: helm/kind-action@v1.4.0
76+
# with:
77+
# kubectl_version: ${{ matrix.k8s }}
78+
# verbosity: 10
79+
80+
# - name: Run chart-testing (install)
81+
# run: ct install --config ct.yaml
82+
83+
lint-docs:
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: Checkout
87+
uses: actions/checkout@v3
88+
- name: Run helm-docs
89+
env:
90+
HELM_DOCS_VERSION: "1.11.0"
91+
run: |
92+
curl --silent --show-error --fail --location --output /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz
93+
tar -xf /tmp/helm-docs.tar.gz helm-docs
94+
./helm-docs
95+
git diff --exit-code

.github/workflows/release-charts.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121

22+
- name: Set up Helm
23+
uses: azure/setup-helm@v3
24+
with:
25+
version: v3.10.0
26+
2227
- name: Configure Git
2328
run: |
2429
git config user.name "$GITHUB_ACTOR"

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: https://github.com/norwoodj/helm-docs
3+
rev: v1.11.0
4+
hooks:
5+
- id: helm-docs
6+
args:
7+
# Make the tool search for charts only under the `example-charts` directory
8+
- --chart-search-root=charts
9+
10+
# The `./` makes it relative to the chart-search-root set above
11+
- --template-files=./templates/README.md.gotmpl

.pre-commit-hooks.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- id: helm-docs
2+
args: []
3+
description: Uses 'helm-docs' to create documentation from the Helm chart's 'values.yaml' file, and inserts the result into a corresponding 'README.md' file.
4+
entry: git-hook/helm-docs
5+
files: (README\.md\.gotmpl|(Chart|requirements|values)\.yaml)$
6+
language: script
7+
name: Helm Docs
8+
require_serial: true
9+
10+
- id: helm-docs-built
11+
args: []
12+
description: Uses auto built 'helm-docs' to create documentation from the Helm chart's 'values.yaml' file, and inserts the result into a corresponding 'README.md' file.
13+
entry: helm-docs
14+
files: (README\.md\.gotmpl|(Chart|requirements|values)\.yaml)$
15+
language: golang
16+
name: Helm Docs Built
17+
require_serial: true

0 commit comments

Comments
 (0)