Code Monkey home page Code Monkey logo

helm-unittest-action's Introduction

Run Helm chart unit tests

Composite action that installs the desired version of Helm through azure/setup-helm, the latest version of the helm-unittest plugin, and then executes chart unit tests for the specified charts or, if none are specified, for every chart found in the repository.

Options

Input Description Required Default
flags Which flags to pass to helm-unittest when running unit tests. No --color
charts Paths to the charts to be tested, separated by spaces. If empty, all charts found are tested. No ""
install-mode One of "force", "if-not-present", or "". More information below. No ""
unittest-version Which version of the helm-unittest plugin to install. Defaults to latest. No ""
helm-version Which version of Helm to install. Passed to azure/setup-helm. Yes latest
github-token GitHub token for the workflow. Passed to azure/setup-helm. Not always needed! No ""

The github-token input is necessary only when installing the latest version of Helm, to overcome GitHub API rate limits. If not given, refer to the azure/setup-helm README for more information.

Unittest Version

unittest-version can be set to an empty string, or to latest. This allows a github variable to be used to "pin" a version, or to use latest since you cannot set a variable to an empty string.

Installation mode

The install-mode input controls how helm-unittest should be installed. These are the available installation modes:

install-mode Behavior
force Installs over any previous version of the plugin.
if-not-present Skips installation if there's a plugin called unittest already installed.
empty Attempts to install the plugin normally. Will fail if already installed.

Examples

This composite action can be used in any workflow that requires Helm unit tests. For every chart it finds, it will run helm dependency update to ensure chart dependencies are present.

name: CI

on: pull_request

jobs:
  unittest:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: d3adb5/helm-unittest-action@v2
        with:
          helm-version: v3.8.0
          github-token: ${{ secrets.GITHUB_TOKEN }}

Note that after the action itself, Helm is installed, so you can run additional Helm commands in the same action if you so choose:

name: CI

on: pull_request

jobs:
  unittest:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: d3adb5/helm-unittest-action@v2
      - run: helm lint my-chart

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.