Skip to content

Cleanup Helm Templates #115

Cleanup Helm Templates

Cleanup Helm Templates #115

Workflow file for this run

name: Test Helm Chart
on:
pull_request:
paths:
- '!*.md'
- 'deploy/charts/version-checker/**'
branches:
- 'main'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
name: Lint Helm Chart
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: azure/setup-helm@v4
- run: helm lint deploy/charts/version-checker
test:
name: Run unit tests for Helm Chart
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: azure/setup-helm@v4
with:
token: ${{ github.token }}
- name: Install helm Plugins
run: |
if [ ! -e "${HELM_PLUGINS}/helm-unittest" ]; then
helm plugin install https://github.com/helm-unittest/helm-unittest.git
fi
- name: Run Tests
run: |
if [ ! -e "deploy/charts/version-checker/tests" ]; then
echo "Not running tests, directory doesn't exist: deploy/charts/version-checker/tests"
exit 0
fi
helm unittest deploy/charts/version-checker
security_policies:
name: Verify that the Helm chart complies with the pod security standards
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install Kyverno CLI
uses: kyverno/[email protected]
- uses: azure/setup-helm@v4
- run: kyverno apply -p https://github.com/kyverno/policies/pod-security/restricted --git-branch main --resource <(helm template deploy/charts/version-checker/)