Skip to content

Commit

Permalink
ci: workflow to test helm chart pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasehlert committed Dec 12, 2024
1 parent ef1db2c commit c00430f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Fetch history
run: git fetch --prune --unshallow
with:
fetch-depth: 0

- name: Configure Git
run: |
Expand Down Expand Up @@ -68,12 +67,12 @@ jobs:

- name: Get Helm Chart versions
id: get_chart_versions
uses: jacobtomlinson/gha-read-helm-chart@master
uses: jacobtomlinson/gha-read-helm-chart@0.1.3
with:
path: ${{ needs.release.outputs.changed_charts }}

- name: Trigger workflow in tibiadata-argocd-app-of-apps repo
uses: peter-evans/repository-dispatch@v3
uses: peter-evans/repository-dispatch@v3.0.0
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: TibiaData/tibiadata-argocd-app-of-apps
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: test-helm-chart

on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: latest

- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.x
check-latest: true

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}

0 comments on commit c00430f

Please sign in to comment.