Skip to content

Commit 4e0fe87

Browse files
author
James Rhoat
authored
Merge pull request #19 from Haloghen/feature/github_workflow
Added Github Workflow to Lint and Test Install
2 parents 523bafa + d726c00 commit 4e0fe87

File tree

3 files changed

+87
-31
lines changed

3 files changed

+87
-31
lines changed

.github/workflows/chart_workflow.yaml

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

.github/workflows/release.yaml

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

ct.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
remote: origin
2+
chart-dirs:
3+
- charts
4+
helm-extra-args: --timeout 900s
5+
target-branch: main
6+
validate-maintainers: false

0 commit comments

Comments
 (0)