Skip to content

Commit

Permalink
Improve chart validation and testing in CI-CD (#15)
Browse files Browse the repository at this point in the history
Improve CI/CD and add extra tests.
  • Loading branch information
antejavor authored Apr 24, 2024
1 parent ce51e2a commit 6e56cfe
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 62 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/chart-validation.yml

This file was deleted.

17 changes: 8 additions & 9 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ name: Lint and Test Charts

on:
pull_request:
branches:
- main
push:
branches:
- main
paths:
- 'charts/**'


jobs:
lint-test:
Expand All @@ -20,15 +18,15 @@ jobs:
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.12.1
version: v3.14.0

- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.12'
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.4.0
uses: helm/chart-testing-action@v2.6.1

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -41,10 +39,11 @@ jobs:
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
continue-on-error: true

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.7.0
uses: helm/kind-action@v1.8.0

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
Expand Down
26 changes: 16 additions & 10 deletions charts/memgraph/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
apiVersion: v1
kind: Pod
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ include "memgraph.fullname" . }}-test-connection"
labels:
name: "{{ .Release.Name }}-memgraph-test"
labels:
{{- include "memgraph.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "memgraph.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
template:
spec:
containers:
- name: memgraph-test
image: memgraph/memgraph:2.16.0
command: ["/bin/sh", "-c"]
args:
- |
echo "RETURN 0;" | mgconsole --host {{ include "memgraph.fullname" . }} --port 7687
restartPolicy: Never
backoffLimit: 4

0 comments on commit 6e56cfe

Please sign in to comment.