Skip to content

Commit

Permalink
feat(ci): added lint and test workflow on PR for helm charts
Browse files Browse the repository at this point in the history
  • Loading branch information
browol committed Nov 26, 2023
1 parent b4604ed commit df356fb
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 168 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Lint and Test Charts

on: pull_request

permissions:
contents: read

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

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

- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: 3.9

- name: Set up chart-testing
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
with:
version: v3.10.0

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --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 --target-branch ${{ github.event.repository.default_branch }}

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

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}
20 changes: 1 addition & 19 deletions charts/general-purpose/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
apiVersion: v2
name: general-purpose
description: A Helm chart for Kubernetes to deploy an Application

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
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.2.9

# 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.
appVersion: 1.16.0
version: 0.2.10
4 changes: 2 additions & 2 deletions charts/general-purpose/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ spec:
httpGet:
path: {{ .Values.app.readinessProbe.path | default "/" }}
port: {{ .Values.app.image.containerPort | default 80 }}
{{ if .Values.app.livenessProbe.httpHeaders }}
httpHeaders: {{ .Values.app.livenessProbe.headers }}
{{ if .Values.app.readinessProbe.httpHeaders }}
httpHeaders: {{ .Values.app.readinessProbe.headers }}
{{ end }}
initialDelaySeconds: {{ .Values.app.readinessProbe.initialDelaySeconds | default 0 }}
periodSeconds: {{ .Values.app.readinessProbe.periodSeconds | default 10 }}
Expand Down
Loading

0 comments on commit df356fb

Please sign in to comment.