Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve chart validation and testing in CI-CD #15

Merged
merged 5 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Loading