Skip to content

Commit

Permalink
OPSEXP-1746: add an helm-unittest action (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxgomz authored Sep 30, 2022
1 parent f3d1025 commit 7f7c7ec
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/actions/helm-unit-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Helm Unit tests
description: >
Look for helm-unittest "test" folder and run the tests
inputs:
plugin_version:
description: version of the helm-unittest plugin to install
required: false
default: v1.0.16
chart-dir:
description: root folder of the chart
required: false
default: .
chart-type:
description: >
type of chart (application or library, empty assumes application)
required: false
default: application
runs:
using: composite
steps:
- name: Run Helm Unit tests
shell: bash
working-directory: ${{ inputs.chart-dir }}
if: ${{ inputs.chart-type }} != 'library'
run: |
set -e
if [ -d tests ]; then echo "${{ inputs.chart-dir }}: Unit tests"
helm plugin install https://github.com/vbehar/helm3-unittest --version ${{ inputs.plugin_version }}
helm dep up
helm unittest --color .
else
echo "No Unit tests implemented for ${{ inputs.chart-dir }} chart!"
fi
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Shared [Travis CI](https://travis-ci.com/), [GitHub Actions](https://docs.github
- [maven-release](#maven-release)
- [nexus-create-staging](#nexus-create-staging)
- [helm-package-chart](#helm-package-chart)
- [helm-unit-test](#helm-unit-test)
- [helm-parse-next-release](#helm-parse-next-release)
- [helm-release-and-publish](#helm-release-and-publish)
- [pre-commit](#pre-commit)
Expand Down Expand Up @@ -519,6 +520,18 @@ The resulting staging repository will be available in the output named `staging-
nexus-password: "${{ secrets.NEXUS_PASSWORD }}"
```

### helm-unit-test

Looks for Helm unit tests written using [helm3-unittest](https://github.com/vbehar/helm3-unittest/blob/master/DOCUMENT.md).

```yaml
- uses: >-
Alfresco/alfresco-build-tools/.github/actions/helm-unit-tests@ref
with:
chart-dir: charts/myapp
chart-type: application
```

### helm-package-chart

Packages a helm chart into a `.tgz` file and provides the name of the file produced in the output named `package-file`.
Expand Down

0 comments on commit 7f7c7ec

Please sign in to comment.