cat #98
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Charts | |
on: | |
push: null | |
pull_request: null | |
workflow_dispatch: null | |
env: | |
UNITTEST_VERSION: v0.3.4 | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
chart: | |
- artifact-caching-proxy | |
- httpredirector | |
- jenkins-jobs | |
- jenkins-kubernetes-agents | |
- mirrorbits | |
- plugin-health-scoring | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get Tools Versions | |
id: tools-versions | |
run: | | |
current_helm_version="$(curl --silent --location https://raw.githubusercontent.com/jenkins-infra/docker-helmfile/main/Dockerfile | grep 'ARG' | grep 'HELM_VERSION=' | sort -u | cut -d'=' -f2)" | |
echo "CURRENT_HELM_VERSION=${current_helm_version}" >> $GITHUB_OUTPUT | |
- name: Set up Helm | |
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3 | |
with: | |
version: "${{ steps.tools-versions.outputs.CURRENT_HELM_VERSION }}" | |
- name: install helm unittests | |
run: | | |
helm env | |
# Repeat 2 times to fight against network errors in GHA runners | |
# Always return true | |
helm plugin install https://github.com/helm-unittest/helm-unittest --version ${UNITTEST_VERSION} \ | |
|| helm plugin install https://github.com/helm-unittest/helm-unittest --version ${UNITTEST_VERSION} \ | |
|| true | |
# Fail if not installed | |
helm plugin list | grep unittest | |
- name: run unit tests | |
working-directory: ./charts/ | |
run: | | |
helm unittest "${{ matrix.chart }}" |