-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (41 loc) · 1.39 KB
/
chart-testing.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: chart-workflow
on:
workflow_call:
pull_request:
jobs:
chart-testing:
runs-on: [ubuntu-latest]
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: Fetch chart dependencies
run: |
for chart in $(cat charts-to-test); do
helm dependency update "$chart" >/dev/null
done
shell: bash
- name: Run Helm Chart Testing
run: |
ct lint 2>&1 | tee chart-testing-output-ct-lint.txt
- 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: Run Helm Unit Test
run: |
helm unittest $(cat charts-to-test) 2>&1 | tee chart-testing-output-helm-unittest.txt
- uses: mshick/add-pr-comment@v2
with:
preformatted: true
message-id: "${{ github.event.number }}"
message-path: chart-testing-output-*.txt