Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI
on:
push:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- &checkout
name: Checkout
uses: actions/checkout@v6
- &setup_helm
name: Set up Helm
uses: azure/setup-helm@v5
- name: Lint
run: helm lint .

unittest:
runs-on: ubuntu-latest
steps:
- *checkout
- *setup_helm
- name: Install helm-unittest
run: helm plugin install https://github.com/helm-unittest/helm-unittest.git --verify=false
- name: Test
run: helm unittest .


schema:
runs-on: ubuntu-latest
steps:
- *checkout
- *setup_helm
- name: Install helm-values-schema-json plugin
run: helm plugin install https://github.com/losisin/helm-values-schema-json.git --verify=false
- name: Generate values schema json
uses: losisin/helm-values-schema-json-action@v3
with:
values: values.yaml
output: values.schema.json
fail-on-diff: true
1 change: 0 additions & 1 deletion .github/workflows/helm-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ jobs:

- name: Run Helm unit tests
run: helm unittest .

8 changes: 8 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
echo 'running helm lint...'
helm lint .

echo 'running helm unittest...'
helm unittest .

echo 'running helm schema generate...'
helm schema -f values.yaml -o values.schema.json
16 changes: 12 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ Thank you for your interest in contributing! This guide covers everything you ne

- [Helm](https://helm.sh/) 3+
- [helm-unittest](https://github.com/helm-unittest/helm-unittest) plugin — for running chart unit tests
- [Node.js](https://nodejs.org/) (see `.node-version`) — only needed for commit linting locally
- [mise](https://mise.jdx.dev/) (optional — manages tool versions automatically)
- [helm-values-schema-json](https://github.com/losisin/helm-values-schema-json) plugin — for generating the schema
- [Node.js](https://nodejs.org/) (see `.node-version`) — only needed for commit linting locally and pre commit hooks
- [mise](https://mise.jdx.dev/) — manages tool versions automatically

### Installation

If you install `mise` first you can just run `mise install` and `mise run setup-helm-plugins` and everything will install for you 🙂.

## Development Workflow

Expand Down Expand Up @@ -48,15 +53,18 @@ This project uses [helm-unittest](https://github.com/helm-unittest/helm-unittest
### Running tests

```bash
# Install the helm-unittest plugin (one-time)
helm plugin install https://github.com/helm-unittest/helm-unittest.git
# Install the needed helm plugins (one-time)
mise run setup-helm-plugins

# Run all unit tests
helm unittest .

# Lint the chart
helm lint .

# Generate the schema
helm schema

# Render templates locally for inspection
helm template .
```
Expand Down
7 changes: 7 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ idiomatic_version_file_enable_tools = ["node"] # use .node-version

[tools]
helm = "4.0.4"

[tasks.setup-helm-plugins]
description = "Install all needed helm plugins needed for development"
run = [
"helm plugin install https://github.com/losisin/helm-values-schema-json.git --verify=false",
"helm plugin install https://github.com/helm-unittest/helm-unittest.git --verify=false",
]
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
"private": true,
"description": "Tooling dependencies for CI (semantic-release and commitlint)",
"devDependencies": {
"semantic-release": "25.0.3",
"conventional-changelog-conventionalcommits": "9.3.1",
"@commitlint/cli": "21.0.1",
"@commitlint/config-conventional": "21.0.1"
"@commitlint/config-conventional": "21.0.1",
"conventional-changelog-conventionalcommits": "9.3.1",
"husky": "^9.1.7",
"semantic-release": "25.0.3"
},
"scripts": {
"prepare": "husky"
}
}
Loading