Skip to content

Commit

Permalink
Add Helm linting
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bull committed Mar 23, 2022
1 parent dbe3425 commit 87ce643
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build-push-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@ name: Publish artifacts
# Run the tasks on every push
on: push
jobs:
helm_lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.8.1

- uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --targer-branch main)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint

build_push_chart:
name: Build and push Helm charts
runs-on: ubuntu-latest
Expand Down
37 changes: 37 additions & 0 deletions chart_schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: str()
home: str(required=False)
version: str()
apiVersion: str()
appVersion: any(str(), num(), required=False)
description: str(required=False)
keywords: list(str(), required=False)
sources: list(str(), required=False)
maintainers: list(include('maintainer'), required=False)
dependencies: list(include('dependency'), required=False)
icon: str(required=False)
engine: str(required=False)
condition: str(required=False)
tags: str(required=False)
deprecated: bool(required=False)
kubeVersion: str(required=False)
annotations: map(str(), str(), required=False)
type: str(required=False)
---
maintainer:
name: str(required=False)
email: str(required=False)
url: str(required=False)
---
dependency:
name: str()
version: str()
repository: str(required=False)
condition: str(required=False)
tags: list(str(), required=False)
enabled: bool(required=False)
import-values: any(list(str()), list(include('import-value')), required=False)
alias: str(required=False)
---
import-value:
child: str()
parent: str()
3 changes: 3 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
chart-dirs:
- .
validate-maintainers: false
42 changes: 42 additions & 0 deletions lintconf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
rules:
braces:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
colons:
max-spaces-before: 0
max-spaces-after: 1
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments:
require-starting-space: true
min-spaces-from-content: 2
document-end: disable
document-start: disable # No --- to start a file
empty-lines:
max: 2
max-start: 0
max-end: 0
hyphens:
max-spaces-after: 1
indentation:
spaces: consistent
indent-sequences: whatever # - list indentation will handle both indentation and without
check-multi-line-strings: false
key-duplicates: enable
line-length: disable # Lines can be any length
new-line-at-end-of-file: enable
new-lines:
type: unix
trailing-spaces: enable
truthy:
level: warning

0 comments on commit 87ce643

Please sign in to comment.