Skip to content

Commit

Permalink
Add script and CI workflow for helm-unittest
Browse files Browse the repository at this point in the history
- Adds script to run helm-unittest locally
- Adds CI workflow to run helm-unittest in GitHub Actions
  • Loading branch information
mitchnielsen committed Jul 25, 2024
1 parent b237cb4 commit b3c14cc
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/helm-unittest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# https://github.com/marketplace/actions/helm-unit-tests

name: Run Helm unit tests

on: pull_request

# Do not grant jobs any permissions by default
permissions: {}

jobs:
unittest:
runs-on: ubuntu-latest
permissions:
# required to read from the repo
contents: read
steps:
- uses: actions/checkout@v3
- uses: d3adb5/helm-unittest-action@v2
with:
helm-version: v3.15.3
21 changes: 21 additions & 0 deletions scripts/helm_unittest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

# This script uses https://github.com/helm-unittest/helm-unittest
# to run unit tests for our Helm Chart templates.
#
# It uses the Docker image to make it easier to run on local machines without
# having to manage the binary and its correct version. Note that if it ever
# appears in https://mise.jdx.dev/registry.html, we can add an entry in .mise.toml.
#
# Dependencies:
# - docker
#
# Usage:
# ./scripts/helm_unittest.sh

version=${VERSION:-3.15.3-0.5.2}

docker run \
-it --rm \
-v $(pwd):/apps \
helmunittest/helm-unittest:${version} charts/prefect-server

0 comments on commit b3c14cc

Please sign in to comment.