Skip to content

Commit a0aab98

Browse files
committed
Feat: add install-test workflow for Helm charts
1 parent 17e14e8 commit a0aab98

File tree

2 files changed

+58
-20
lines changed

2 files changed

+58
-20
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Test Helm Charts
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Lint Helm Charts"]
6+
types: [completed]
7+
8+
jobs:
9+
install-test:
10+
if: >
11+
github.event.workflow_run.conclusion == 'success' &&
12+
github.event.workflow_run.event == 'pull_request'
13+
14+
environment: github-cicd
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Set up Helm
24+
uses: azure/setup-helm@v3
25+
with:
26+
version: v3.12.1
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: "3.10"
32+
check-latest: true
33+
34+
- name: Set up chart-testing
35+
uses: helm/[email protected]
36+
37+
- name: Run chart-testing (list-changed)
38+
id: list-changed
39+
run: |
40+
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
41+
if [[ -n "$changed" ]]; then
42+
echo "changed=true" >> "$GITHUB_OUTPUT"
43+
fi
44+
45+
- name: Create kind cluster
46+
if: steps.list-changed.outputs.changed == 'true'
47+
uses: helm/[email protected]
48+
49+
- name: Run chart-testing (install)
50+
if: steps.list-changed.outputs.changed == 'true'
51+
run: ct install --target-branch ${{ github.event.repository.default_branch }}

.github/workflows/lint-test.yaml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: Lint and Test Charts
1+
name: Lint Helm Charts
22

3-
on: pull_request
3+
on:
4+
pull_request:
45

56
jobs:
6-
lint-test:
7+
lint:
78
runs-on: ubuntu-latest
89
steps:
9-
- name: Checkout
10-
uses: actions/checkout@v3
10+
- uses: actions/checkout@v3
1111
with:
1212
fetch-depth: 0
1313

@@ -16,30 +16,17 @@ jobs:
1616
with:
1717
version: v3.12.1
1818

19-
- uses: actions/setup-python@v4
20-
with:
21-
python-version: "3.10"
22-
check-latest: true
23-
2419
- name: Set up chart-testing
2520
uses: helm/[email protected]
2621

27-
- name: Run chart-testing (list-changed)
22+
- name: List changed charts
2823
id: list-changed
2924
run: |
3025
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
3126
if [[ -n "$changed" ]]; then
3227
echo "changed=true" >> "$GITHUB_OUTPUT"
3328
fi
3429
35-
- name: Run chart-testing (lint)
30+
- name: Lint charts
3631
if: steps.list-changed.outputs.changed == 'true'
3732
run: ct lint --validate-maintainers=false --target-branch ${{ github.event.repository.default_branch }}
38-
39-
- name: Create kind cluster
40-
if: steps.list-changed.outputs.changed == 'true'
41-
uses: helm/[email protected]
42-
43-
- name: Run chart-testing (install)
44-
if: steps.list-changed.outputs.changed == 'true'
45-
run: ct install --target-branch ${{ github.event.repository.default_branch }}

0 commit comments

Comments
 (0)