-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (67 loc) · 2.32 KB
/
ci.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CI Helm Charts
on:
pull_request:
paths:
- 'charts/**'
jobs:
call-changed-charts-workflow:
uses: ./.github/workflows/lib-list-changed-charts.yaml
secrets: inherit
test:
needs: call-changed-charts-workflow
runs-on: ubuntu-latest
strategy:
matrix:
include: ${{ fromJson(needs.call-changed-charts-workflow.outputs.charts) }}
steps:
- uses: actions/checkout@v4
- name: "Run helm unit tests on ${{ matrix.chart }}"
uses: d3adb5/helm-unittest-action@v2
with:
install-mode: "if-not-present"
helm-version: v3.8.0
github-token: ${{ secrets.GITHUB_TOKEN }}
charts: "${{ matrix.chart }}"
flags: "--color -f './tests/*/*.yaml'"
lint:
needs: call-changed-charts-workflow
runs-on: ubuntu-latest
strategy:
matrix:
include: ${{ fromJson(needs.call-changed-charts-workflow.outputs.charts) }}
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Set up Helm"
uses: azure/setup-helm@v4
with:
version: v3.12.1
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: '3.10'
check-latest: true
- name: "Set up chart-testing"
uses: helm/[email protected]
- name: "Run chart-testing (lint: ${{ matrix.chart }} )"
run: |
cd ${{ matrix.chart }}
ct lint --target-branch ${{ github.event.repository.default_branch }} --charts .
- name: "Generate a cluster name from ${{ matrix.chart }}"
id: kind-cluster-name
run: |
name=${{ matrix.chart }}
echo "cluster_name=${name#charts/}" >> $GITHUB_OUTPUT
- name: "Create kind cluster for char ${{ matrix.chart }}"
uses: helm/[email protected]
with:
cluster_name: ${{ steps.kind-cluster-name.outputs.cluster_name }}
config: lib/Kind/cluster.yaml
- name: "Run chart-testing (install: ${{ matrix.chart }} )"
run: |
cd ${{ matrix.chart }}
ct install --target-branch ${{ github.event.repository.default_branch }} --charts .
## For more information on how to reuse workflows,
## read here: https://docs.github.com/en/actions/using-workflows/reusing-workflows