Skip to content

Commit

Permalink
feat(actions): Add linting and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
plcnk committed Aug 16, 2024
1 parent aa0dd39 commit d9f460f
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/cr-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
generate-release-notes: true
skip-existing: true
2 changes: 2 additions & 0 deletions .github/ct-install-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
debug: true
all: true
2 changes: 2 additions & 0 deletions .github/ct-lint-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
debug: true
all: true
58 changes: 58 additions & 0 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Lint and Test Charts

on:
push:
branches: [master]
paths:
- "charts/**"
- ".github/workflows/**"
pull_request:
branches: [master]
paths:
- "charts/**"
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Run chart-testing (lint)
run: ct lint --config .github/ct-lint-config.yaml

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

- name: Install Helm
uses: azure/setup-helm@v4

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

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --chart-dirs charts --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing (lint)
run: |
helm repo add bjw-s https://bjw-s.github.io/helm-charts
ct lint --chart-dirs charts --all
- name: Create kind cluster
uses: helm/[email protected]

- name: Run chart-testing (install)
run: ct install --config .github/ct-install-config.yaml
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:
uses: helm/[email protected]
if: steps.package_charts.outputs.changed_charts != ''
with:
config: .github/cr-config.yaml
skip_packaging: true
env:
CR_TOKEN: ${{ steps.app-token.outputs.token }}

0 comments on commit d9f460f

Please sign in to comment.