Skip to content

Commit b15f994

Browse files
committed
Added Linting and Testing CI
1 parent 523bafa commit b15f994

File tree

2 files changed

+77
-31
lines changed

2 files changed

+77
-31
lines changed

.github/workflows/chart_workflow.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Lint, Test and Deploy Charts
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
lint-test:
8+
name: "Lint and Test"
9+
runs-on: ubuntu-22.04
10+
if: github.ref != 'refs/heads/main'
11+
steps:
12+
- name: "Checkout"
13+
uses: actions/checkout@v2.4.2
14+
with:
15+
fetch-depth: 0
16+
17+
- name: "Set Up Helm"
18+
uses: azure/setup-helm@v3.3
19+
with:
20+
version: v3.4.1
21+
22+
- name: "Set Up Python"
23+
uses: actions/setup-python@v4.2.0
24+
with:
25+
python-version: 3.9
26+
27+
- name: "Set up chart-testing"
28+
uses: helm/chart-testing-action@v2.3.0
29+
with:
30+
version: v3.3.0
31+
32+
- name: "Run chart-testing (list-changed)"
33+
id: list-changed
34+
run: |
35+
changed=$(ct list-changed --config ct.yaml)
36+
if [[ -n "$changed" ]]; then
37+
echo "::set-output name=changed::true"
38+
fi
39+
40+
- name: "Run chart-testing (lint)"
41+
run: ct lint --config ct.yaml
42+
if: steps.list-changed.outputs.changed == 'true'
43+
44+
- name: Create kind cluster
45+
uses: helm/kind-action@v1.4.0
46+
if: steps.list-changed.outputs.changed == 'true'
47+
48+
- name: Run chart-testing (install)
49+
run: ct install --config ct.yaml
50+
if: steps.list-changed.outputs.changed == 'true'
51+
52+
release:
53+
runs-on: ubuntu-latest
54+
if: github.ref == 'refs/heads/main'
55+
needs:
56+
- lint-test
57+
name: "Release Chart on GH"
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v2
61+
with:
62+
fetch-depth: 0
63+
64+
- name: Configure Git
65+
run: |
66+
git config user.name "$GITHUB_ACTOR"
67+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
68+
69+
- name: Install Helm
70+
uses: azure/setup-helm@v1
71+
with:
72+
version: v3.4.0
73+
74+
- name: Run chart-releaser
75+
uses: helm/chart-releaser-action@v1.0.0
76+
env:
77+
CR_TOKEN: '${{ secrets.CR_TOKEN }}'

.github/workflows/release.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)