-
Notifications
You must be signed in to change notification settings - Fork 100
107 lines (92 loc) · 3 KB
/
lint_test.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Lint and test charts
# Controls when the action will run. Triggers the workflow on pull request
# events but only for the main branch
on:
pull_request:
branches:
- main
jobs:
prepare:
name: "Prepare requirements"
runs-on: ubuntu-latest
outputs:
charts: ${{ steps.list-changed.outputs.charts }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up helm
uses: './.github/actions/setup-helm'
- name: Set up test
uses: './.github/actions/setup-test'
- name: List changed charts
id: list-changed
run: |
changed=$(ct --config ct.yaml list-changed)
json_charts="[]"
if [[ -n "$changed" ]]; then
json_charts="[\"$(echo $changed | sed 's/ /", "/g')\"]"
fi
echo "charts=${json_charts}" >> "$GITHUB_OUTPUT"
lint:
name: "Lint"
needs: prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
chart: ${{ fromJson(needs.prepare.outputs.charts) }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up helm
uses: './.github/actions/setup-helm'
- name: Set up test
uses: './.github/actions/setup-test'
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml
test:
name: "Test"
needs: prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
chart: ${{ fromJson(needs.prepare.outputs.charts) }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up helm
uses: './.github/actions/setup-helm'
- name: Set up test
uses: './.github/actions/setup-test'
- name: Create kind cluster
uses: helm/[email protected]
- name: Install CRDs
env:
CHART_NAME: ${{ matrix.chart }}
run: |
# Prometheus
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts --force-update
helm install prometheus-operator-crds prometheus-community/prometheus-operator-crds --version 4.0.0
# Istio
if [[ "$CHART_NAME" != *"istio-operator-crds" ]]; then
helm repo add wiremind https://wiremind.github.io/wiremind-helm-charts --force-update
helm install istio-operator-crds wiremind/istio-operator-crds --version 1.18.2
fi
# csi-driver-host-path
if [[ "$CHART_NAME" == *"csi-driver-host-path" ]]; then
helm repo add wiremind https://wiremind.github.io/wiremind-helm-charts --force-update
helm install snapshot-controller-crds wiremind/snapshot-controller-crds --version 6.2.1
fi
- name: Run chart-testing (install)
run: ct install --config ct.yaml --helm-extra-args "--timeout 300s"