87 lines
2.6 KiB
YAML
87 lines
2.6 KiB
YAML
name: Validate Helm Chart
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- "charts/**"
|
|
- ".github/workflows/arc-validate-chart.yaml"
|
|
- "!charts/actions-runner-controller/docs/**"
|
|
- "!**.md"
|
|
- "!charts/gha-runner-scale-set-controller/**"
|
|
- "!charts/gha-runner-scale-set/**"
|
|
push:
|
|
paths:
|
|
- "charts/**"
|
|
- ".github/workflows/arc-validate-chart.yaml"
|
|
- "!charts/actions-runner-controller/docs/**"
|
|
- "!**.md"
|
|
- "!charts/gha-runner-scale-set-controller/**"
|
|
- "!charts/gha-runner-scale-set/**"
|
|
workflow_dispatch:
|
|
env:
|
|
KUBE_SCORE_VERSION: 1.10.0
|
|
HELM_VERSION: v3.8.0
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
# This will make sure we only apply the concurrency limits on pull requests
|
|
# but not pushes to master branch by making the concurrency group name unique
|
|
# for pushes
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
validate-chart:
|
|
name: Lint Chart
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Helm
|
|
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4
|
|
with:
|
|
version: ${{ env.HELM_VERSION }}
|
|
|
|
# python is a requirement for the chart-testing action below (supports yamllint among other tests)
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Set up chart-testing
|
|
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b
|
|
|
|
- name: Run chart-testing (list-changed)
|
|
id: list-changed
|
|
run: |
|
|
changed=$(ct list-changed --config charts/.ci/ct-config.yaml)
|
|
if [[ -n "$changed" ]]; then
|
|
echo "changed=true" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Run chart-testing (lint)
|
|
run: |
|
|
ct lint --config charts/.ci/ct-config.yaml
|
|
|
|
- name: Create kind cluster
|
|
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3
|
|
if: steps.list-changed.outputs.changed == 'true'
|
|
|
|
# We need cert-manager already installed in the cluster because we assume the CRDs exist
|
|
- name: Install cert-manager
|
|
if: steps.list-changed.outputs.changed == 'true'
|
|
run: |
|
|
helm repo add jetstack https://charts.jetstack.io --force-update
|
|
helm install cert-manager jetstack/cert-manager --set installCRDs=true --wait
|
|
|
|
- name: Run chart-testing (install)
|
|
if: steps.list-changed.outputs.changed == 'true'
|
|
run: |
|
|
ct install --config charts/.ci/ct-config.yaml
|