mirror of
https://github.com/plcnk/charts.git
synced 2026-04-06 01:34:23 +00:00
feat(actions): Add linting and testing
This commit is contained in:
58
.github/workflows/lint-test.yaml
vendored
Normal file
58
.github/workflows/lint-test.yaml
vendored
Normal file
@ -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/chart-testing-action@v2.6.1
|
||||
|
||||
- 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/chart-testing-action@v2.6.1
|
||||
|
||||
- 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/kind-action@v1.10.0
|
||||
|
||||
- name: Run chart-testing (install)
|
||||
run: ct install --config .github/ct-install-config.yaml
|
||||
Reference in New Issue
Block a user