-
Notifications
You must be signed in to change notification settings - Fork 13
83 lines (76 loc) · 2.33 KB
/
ci.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
name: CI
concurrency:
group: ci-${{ github.run_id }}
cancel-in-progress: true
on:
push:
branches:
- main
- v[0-9]+
- v[0-9]+.[0-9]+
- cryostat-v[0-9]+.[0-9]+
pull_request:
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled
branches:
- main
- v[0-9]+
- v[0-9]+.[0-9]+
- cryostat-v[0-9]+.[0-9]+
env:
TARGET_BRANCH: ${{ github.event.pull_request.base.ref || github.ref_name }}
TEST_NAMESPACE: helm-test
jobs:
lint-chart:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.14.4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
check-latest: true
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: Lint chart
run: ct lint --target-branch ${TARGET_BRANCH} --lint-conf lintconf.yaml --config ct.yaml --chart-yaml-schema chart_schema.yaml
test-chart:
runs-on: ubuntu-latest
steps:
- name: Fail if safe-to-test label NOT applied
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'safe-to-test') }}
run: exit 1
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.14.4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
check-latest: true
- uses: helm/chart-testing-action@v2.6.1
- name: Set up Kind cluster
uses: helm/kind-action@v1
with:
cluster_name: ci-${{ github.run_id }}
- name: Install and test chart
run: |
# FIXME: Remove when chart-testing fixes the issue https://github.com/helm/chart-testing/issues/525
HELM_LOCATION="$(which helm)"
sudo mv $HELM_LOCATION "$(dirname $HELM_LOCATION)/.helm"
cat <(echo '#!/usr/bin/env bash') <(echo 'exec .helm "${@//--reuse-values/--reset-then-reuse-values}"') | sudo tee $HELM_LOCATION
sudo chmod +x $HELM_LOCATION
kubectl create ns $TEST_NAMESPACE
ct install --target-branch ${TARGET_BRANCH} --upgrade --namespace=$TEST_NAMESPACE --config ct.yaml --debug