Skip to content

Commit c00430f

Browse files
committed
ci: workflow to test helm chart pull requests
1 parent ef1db2c commit c00430f

File tree

2 files changed

+51
-5
lines changed

2 files changed

+51
-5
lines changed

.github/workflows/release.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ jobs:
2020
steps:
2121
- name: Checkout Code
2222
uses: actions/checkout@v4
23-
24-
- name: Fetch history
25-
run: git fetch --prune --unshallow
23+
with:
24+
fetch-depth: 0
2625

2726
- name: Configure Git
2827
run: |
@@ -68,12 +67,12 @@ jobs:
6867

6968
- name: Get Helm Chart versions
7069
id: get_chart_versions
71-
uses: jacobtomlinson/gha-read-helm-chart@master
70+
uses: jacobtomlinson/gha-read-helm-chart@0.1.3
7271
with:
7372
path: ${{ needs.release.outputs.changed_charts }}
7473

7574
- name: Trigger workflow in tibiadata-argocd-app-of-apps repo
76-
uses: peter-evans/repository-dispatch@v3
75+
uses: peter-evans/repository-dispatch@v3.0.0
7776
with:
7877
token: ${{ secrets.REPO_ACCESS_TOKEN }}
7978
repository: TibiaData/tibiadata-argocd-app-of-apps

.github/workflows/test.yaml

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

0 commit comments

Comments
 (0)