Skip to content

Commit

Permalink
action test to see if worth doing
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuba committed May 21, 2024
1 parent 832a74e commit c69066f
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 16 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/api_ops_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# See https://github.com/helm/chart-testing-action
name: Lint and Test Charts

on:
push:
branches:
#- main
- local_api_infra
pull_request:
workflow_dispatch:

jobs:
ops-lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@v3
# as of 2022/12 the set-output still not fixed in this action
# https://github.com/Azure/setup-helm/issues/103
with:
version: v3.12.1

- name: Install chart-testing
uses: helm/[email protected]

- name: Run chart-testing (lint)
run: ct lint --charts ./api/local/api --debug

- name: Start minikube - if this breaks on local do a 'minikube delete'
id: minikube
uses: medyagh/setup-minikube@master
with:
cpus: 2
memory: 2G # 1.9G recommended minimum
start-args: '--force'

- name: Run chart-testing (install)
run: ct install --charts ./api/local/api

- name: Cleanup
run: |
minikube delete
if: ${{ always() }}
18 changes: 6 additions & 12 deletions api/local/api/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
apiVersion: v2
name: api
description: A Helm chart for Kubernetes
maintainers:
# See https://github.com/helm/chart-testing/issues/192
# for why the maintainer doesn't validate if the name field is the name of an actual human that exists (afaict)
- name: LA # Liviu Anita
email: [email protected]

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
appVersion: "0.1.0"
1 change: 0 additions & 1 deletion api/local/api/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
nodePort: {{ .Values.service.port }}
selector:
{{- include "api.selectorLabels" . | nindent 4 }}
2 changes: 1 addition & 1 deletion api/local/api/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ spec:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "api.fullname" . }}:{{ .Values.service.port }}']
args: ['{{ include "api.fullname" . }}:{{ .Values.service.port }}/v1/openapi.json']
restartPolicy: Never
4 changes: 2 additions & 2 deletions api/local/api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ingress:
- path: /
pathType: ImplementationSpecific

resources:
resources:
limits:
memory: "1G"
cpu: "1"
Expand All @@ -33,4 +33,4 @@ api_env:
mongoHost: ""
dbName: "bia-integrator"
jwtSecretKey: ""
userCreateSecretToken: ""
userCreateSecretToken: ""

0 comments on commit c69066f

Please sign in to comment.