1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

Add Helm tests to Github Actions (#1793)

This reverts commit 2749280b6c.

Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
This commit is contained in:
treydock 2021-04-13 13:39:27 -04:00 committed by GitHub
parent 2749280b6c
commit 67973c2776
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 1 deletions

View file

@ -173,3 +173,23 @@ jobs:
run: |
export PROJECT_PATH=$(pwd)
make test-all
helm-tests:
runs-on: ubuntu-latest
needs: pre-checks
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.0.1
- name: Run chart-testing (lint)
run: ct lint --target-branch=main --check-version-increment=false

View file

@ -30,6 +30,14 @@ jobs:
with:
go-version: 1.14
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.5.0
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.0.1
- name: Cache Go modules
uses: actions/cache@v1
with:
@ -76,4 +84,16 @@ jobs:
sleep 20
echo ">>> Run Kyverno e2e test"
make test-e2e
kubectl delete -f ${GITHUB_WORKSPACE}/definitions/install.yaml
- name: Update chart values
run: |
sed -i -e "s|nameOverride:.*|nameOverride: kyverno|g" charts/kyverno/values.yaml
sed -i -e "s|fullnameOverride:.*|fullnameOverride: kyverno|g" charts/kyverno/values.yaml
sed -i -e "s|namespace:.*|namespace: kyverno|g" charts/kyverno/values.yaml
sed -i -e "s|tag:.*|tag: $(git describe --always --tags)|g" charts/kyverno/values.yaml
- name: Run chart-testing (install)
run: |
kubectl create namespace kyverno
ct install --target-branch=main --namespace=kyverno

View file

@ -0,0 +1,18 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ template "kyverno.fullname" . }}-test"
labels:
{{- include "kyverno.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command:
- /bin/sh
- -c
- |
sleep 20 ; wget -O- -S --no-check-certificate https://{{ template "kyverno.serviceName" . }}:{{ .Values.service.port }}/health/liveness
restartPolicy: Never

View file

@ -152,4 +152,3 @@ service:
# 3) Let Helm generate a self signed cert, by setting createSelfSignedCert true
# If letting Kyverno create its own CA or providing your own, make createSelfSignedCert is false
createSelfSignedCert: false