Skip to content

Commit

Permalink
chore(helm): lint and test chart
Browse files Browse the repository at this point in the history
Create a GitHub Action that lints the Helm chart and tests installing to
a KinD cluster.

Bug: #90
  • Loading branch information
terinjokes committed Dec 31, 2023
1 parent 91cc01c commit 9e7b647
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/charts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test Charts
on:
- pull_request
- push
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
chart-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: azure/setup-helm@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
check-latest: true
- uses: helm/chart-testing-action@v2
- name: chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --chart-dirs deploy/charts)
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: chart-testing (lint)
# if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }} --chart-dirs deploy/charts
- uses: helm/kind-action@v1
# if: steps.list-changed.outputs.changed == 'true'
- name: chart-testing (install)
# if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }} --chart-dirs deply/charts
3 changes: 3 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Docker
on:
- pull_request
- push
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
docker:
runs-on: ubuntu-latest
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ name: Test
on:
- pull_request
- push
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
unit:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ 'stable', 'oldstable' ]
name: 'Go ${{ matrix.go }} Test'
go: ["stable", "oldstable"]
name: "Go ${{ matrix.go }} Test"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
Expand All @@ -21,7 +24,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 'stable'
go-version: "stable"
- uses: dominikh/staticcheck-action@v1
with:
build-tags: suite
Expand All @@ -35,7 +38,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 'stable'
go-version: "stable"
- run: |
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
source <(setup-envtest use -p env)
Expand Down
4 changes: 3 additions & 1 deletion deploy/charts/origin-ca-issuer/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
apiVersion: v1
name: origin-ca-issuer
version: 0.5.1
version: 0.5.2
appVersion: 0.6.1
description: A Helm chart for origin-ca-issuer
home: https://github.com/cloudflare/origin-ca-issuer
maintainers:
- name: terinjokes
keywords:
- cert-manager
- cloudflare
Expand Down

0 comments on commit 9e7b647

Please sign in to comment.