Skip to content

Commit

Permalink
Merge pull request #44 from energywebfoundation/DOI-3055-Include-helm…
Browse files Browse the repository at this point in the history
…-install-in-generic-microservice-helm-chart-test-pipeline

Doi 3055 include helm install in generic microservice helm chart test pipeline
  • Loading branch information
michalziobro authored Apr 19, 2024
2 parents e56c442 + a399341 commit 6dd07d3
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 7 deletions.
43 changes: 40 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,54 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: styfle/cancel-workflow-action@0.9.0
- uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

helm-check:
runs-on: ubuntu-latest
needs: [cancel-previous]
steps:
- uses: actions/checkout@v2
- name: helm-check
- uses: actions/checkout@v4
- name: helm-check-default
uses: igabaydulin/[email protected]
env:
CHART_LOCATION: ./
CHART_VALUES: ./values.yaml
- name: helm-check-test
uses: igabaydulin/[email protected]
env:
CHART_LOCATION: ./
CHART_VALUES: ./ci/test-values.yaml

test-k8s:
runs-on: ubuntu-latest
needs: [helm-check]
strategy:
matrix:
k8s-version: [ v1.27.12, v1.26.15 ]
steps:
- uses: actions/checkout@v4

- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.10.3

- uses: actions/setup-python@v5
with:
python-version: '3.10'
check-latest: true

- name: Set up chart-testing
uses: helm/[email protected]
with:
version: v3.10.1

- name: Create Kind cluster
uses: helm/[email protected]
with:
kubectl_version: ${{ matrix.k8s-version }}

- name: Run chart-testing (install)
run: ct install --config ci/config.yaml
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: styfle/cancel-workflow-action@0.11.0
- uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

Expand All @@ -26,7 +26,7 @@ jobs:
changelog: ${{ steps.tag_version.outputs.changelog }}
tag: ${{ steps.tag_version.outputs.new_tag }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Take the 1st version from Chart.yaml
- name: Get Chart Version
Expand All @@ -50,13 +50,13 @@ jobs:

steps:
- name: Create a GitHub release
uses: ncipollo/release-action@v1.12.0
uses: ncipollo/release-action@v1.14.0
with:
tag: ${{ needs.push-tag.outputs.tag }}
name: Release ${{ needs.push-tag.outputs.tag }}
body: ${{ needs.push-tag.outputs.changelog }}

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Push Helm chart to OCI compatible registry (Github)
uses: bsord/[email protected]
Expand Down
4 changes: 4 additions & 0 deletions ci/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
chart-repos:
- bitnami=https://charts.bitnami.com/bitnami
charts: ./
helm-extra-args: "--timeout 60s"
1 change: 1 addition & 0 deletions ci/default-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Keep empty file for chart testing to grab defaults from values.yaml
39 changes: 39 additions & 0 deletions ci/test-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
replicaCount: 2

# Pod disruption budget will be created only if replicaCount > 1
pdb:
enabled: true
minAvailable: 1

readinessProbe:
enabled: true
initialDelaySeconds: 10

livenessProbe:
enabled: true
initialDelaySeconds: 10

image:
repository: nginx
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "latest"

autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 3
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

# Allows you to add any config files in specified mount path
configFiles:
config.yml: |
key: value
example.json: |
{
"key1": "value1",
"key2": "value2"
}
configFilesMountPath: /usr/share/config

0 comments on commit 6dd07d3

Please sign in to comment.