Skip to content

Commit 51fb334

Browse files
committed
Add GitHub workflow for lint, test and release
Signed-off-by: Torsten Walter <[email protected]>
1 parent 91a2a39 commit 51fb334

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

.github/workflows/lint-test.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Lint and Test Charts
2+
3+
on: pull_request
4+
5+
jobs:
6+
lint-test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
12+
- name: Fetch history
13+
run: git fetch --prune --unshallow
14+
15+
- name: Run chart-testing (lint)
16+
id: lint
17+
uses: helm/[email protected]
18+
with:
19+
command: lint
20+
config: ct.yaml
21+
22+
- name: Create kind cluster
23+
uses: helm/[email protected]
24+
if: steps.lint.outputs.changed == 'true'
25+
26+
- name: Run chart-testing (install)
27+
uses: helm/[email protected]
28+
with:
29+
command: install
30+
config: ct.yaml

.github/workflows/release.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release Charts
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Fetch history
16+
run: git fetch --prune --unshallow
17+
18+
- name: Configure Git
19+
run: |
20+
git config user.name "$GITHUB_ACTOR"
21+
git config user.email "[email protected]"
22+
23+
# See https://github.com/helm/chart-releaser-action/issues/6
24+
- name: Install Helm
25+
run: |
26+
curl -fsSLo get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
27+
chmod 700 get_helm.sh
28+
./get_helm.sh
29+
30+
- name: Add dependency chart repos
31+
run: |
32+
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
33+
helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
34+
35+
- name: Run chart-releaser
36+
uses: helm/[email protected]
37+
env:
38+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

ct.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# See https://github.com/helm/chart-testing#configuration
2+
remote: origin
3+
target-branch: main
4+
chart-dirs:
5+
- charts
6+
helm-extra-args: --timeout 600s

0 commit comments

Comments
 (0)