Skip to content

Commit

Permalink
Add chart-testing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sl1pm4t committed Nov 26, 2024
1 parent e7454d8 commit 8cf1d17
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 280 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/chart-testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: chart-workflow

on:
workflow_call:
pull_request:

jobs:
chart-testing:
runs-on: [self-hosted, cloud-infra-ci-runner-small]
container:
image: quay.io/helmpack/chart-testing:v3.11.0
options: --user 1001
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run Helm Chart Testing
run: |
ct lint > ct-lint-output.txt
- uses: mshick/add-pr-comment@v2
with:
preformatted: true
message-id: "${{ github.event.number }}"
message-path: ct-lint-output.txt

helm-unit-test:
runs-on: [self-hosted, cloud-infra-ci-runner-small]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Helm
uses: azure/[email protected]

- name: Install dependencies
run: |
helm plugin install https://github.com/helm-unittest/helm-unittest.git
- name: Assemble list of chart directories to test
run: |
tr ' ' '\n' <<< "${{ inputs.charts }}" | grep -v '^$' > charts-to-test || true
find . -type f -name 'Chart.yaml' -exec dirname {} \; > all-charts
[ -z "${{ inputs.charts }}" ] && mv all-charts charts-to-test || true
shell: bash

- name: Fetch chart dependencies
run: |
for chart in $(cat charts-to-test); do
helm dependency update "$chart" >/dev/null
done
shell: bash

- name: Run Helm Unit Test
run: |
helm unittest $(cat charts-to-test) > helm-unittest-output.txt
- uses: mshick/add-pr-comment@v2
with:
preformatted: true
message-id: "${{ github.event.number }}"
message-path: helm-unittest-output.txt



4 changes: 2 additions & 2 deletions charts/kafka/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
description: Setup a Kafka cluster
description: Setup a Kafka cluster using Strimzi operator
name: kafka
version: 0.3.0
version: 0.3.1
type: application
dependencies: []
278 changes: 0 additions & 278 deletions charts/kafka/cloud-values.yaml

This file was deleted.

0 comments on commit 8cf1d17

Please sign in to comment.