Skip to content

Commit

Permalink
ci: add helm lint action
Browse files Browse the repository at this point in the history
  • Loading branch information
MindTooth committed Nov 3, 2023
1 parent be6d936 commit 679e6de
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 3 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/lint-helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Lint and Test Charts

on: pull_request

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

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

- uses: actions/setup-python@v4
name: Setup Python
with:
python-version: "3.10"
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.0

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ./ct.yaml --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config ./ct.yaml --target-branch ${{ github.event.repository.default_branch }}

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.8.0

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --config ./ct.yaml --target-branch ${{ github.event.repository.default_branch }}
10 changes: 8 additions & 2 deletions containers/helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v2
name: helm
description: A Helm chart for Password Pusher
Expand All @@ -15,10 +16,15 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
version: 0.2.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.26.6"
appVersion: "1.37.9"

maintainers:
- name: pglombardo
email: pglombardo@hey.com
url: https://the0x00.dev/
2 changes: 1 addition & 1 deletion containers/helm/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
nameOverride: ""
fullnameOverride: ""
namespace: pwpush
replicaCount: 1

deployment:
Expand Down
5 changes: 5 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# https://github.com/helm/chart-testing
---
remote: origin
chart-dirs:
- containers

0 comments on commit 679e6de

Please sign in to comment.