Skip to content

Commit 1a4a296

Browse files
mergify[bot]tthvo
andauthored
feat(ci): workflow to lint and test charts (#73) (#85)
* chore(chart): put cryostat chart into charts directory * feat(ci): workflow to lint and test charts https://redhat-cop.github.io/ci/linting-testing-helm-charts.html * feat(ci): add partial values for test scenarios * chore(ci): use ref name without sub (cherry picked from commit adeac87) Co-authored-by: Thuan Vo <thvo@redhat.com>
1 parent 4386ec1 commit 1a4a296

25 files changed

+145
-2
lines changed

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
concurrency:
4+
group: ci-${{ github.run_id }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
- v[0-9]+
12+
- v[0-9]+.[0-9]+
13+
- cryostat-v[0-9]+.[0-9]+
14+
15+
pull_request:
16+
types:
17+
- opened
18+
- reopened
19+
- synchronize
20+
- labeled
21+
- unlabeled
22+
branches:
23+
- main
24+
- v[0-9]+
25+
- v[0-9]+.[0-9]+
26+
- cryostat-v[0-9]+.[0-9]+
27+
28+
env:
29+
TARGET_BRANCH: ${{ github.event.pull_request.base.ref || github.ref_name }}
30+
31+
jobs:
32+
lint-chart:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v2
36+
with:
37+
fetch-depth: 0
38+
- name: Set up Helm
39+
uses: azure/setup-helm@v3
40+
with:
41+
version: v3.11.2
42+
- uses: actions/setup-python@v4
43+
with:
44+
python-version: '3.9'
45+
check-latest: true
46+
- name: Set up chart-testing
47+
uses: helm/chart-testing-action@v2.4.0
48+
- name: Lint chart
49+
run: ct lint --target-branch ${TARGET_BRANCH} --lint-conf lintconf.yaml --config ct.yaml --chart-yaml-schema chart_schema.yaml
50+
test-chart:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Fail if safe-to-test label NOT applied
54+
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'safe-to-test') }}
55+
run: exit 1
56+
- uses: actions/checkout@v2
57+
with:
58+
fetch-depth: 0
59+
- name: Set up Helm
60+
uses: azure/setup-helm@v3
61+
with:
62+
version: v3.11.2
63+
- uses: actions/setup-python@v4
64+
with:
65+
python-version: '3.9'
66+
check-latest: true
67+
- uses: helm/chart-testing-action@v2.4.0
68+
- name: Set up Kind cluster
69+
run: kind create cluster -n ci-${{ github.run_id }}
70+
- name: Install and test chart
71+
run: |
72+
kubectl create ns helm-test
73+
ct install --target-branch ${TARGET_BRANCH} --upgrade --namespace=helm-test --config ct.yaml
74+
- name: Clean up Kind cluster
75+
run: kind delete cluster -n ci-${{ github.run_id }}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cryostat/LICENSE
1+
charts/cryostat/LICENSE

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cryostat/README.md
1+
charts/cryostat/README.md

chart_schema.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Chart.yaml schema
2+
apiVersion: str(required=True)
3+
name: str()
4+
description: str(required=True)
5+
type: str()
6+
version: str()
7+
kubeVersion: str(required=True)
8+
appVersion: str(required=True)
9+
home: str(required=True)
10+
icon: str(required=True)
11+
keywords: list(str(), required=True)
12+
sources: list(str(), required=True)
13+
maintainers: list(include('maintainer'), required=True)
14+
---
15+
maintainer:
16+
name: str(required=True)
17+
url: str(required=True)
File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
minimal: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
minimal: false

0 commit comments

Comments
 (0)