Skip to content

Merge pull request #108 from madejackson/patch-1 #29

Merge pull request #108 from madejackson/patch-1

Merge pull request #108 from madejackson/patch-1 #29

name: Lint and Test Charts
on:
push:
paths:
- 'charts/**'
- '.github/**'
pull_request:
paths:
- 'charts/**'
- '.github/**'
workflow_dispatch:
env:
KUBE_SCORE_VERSION: 1.17.0
HELM_VERSION: v3.13.2
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: ${{ env.HELM_VERSION }}
- name: Set up kube-score
run: |
mkdir /tmp/bin
wget https://github.com/zegl/kube-score/releases/download/v${{ env.KUBE_SCORE_VERSION }}/kube-score_${{ env.KUBE_SCORE_VERSION }}_linux_amd64 -O /tmp/bin/kube-score
chmod 755 /tmp/bin/kube-score
- name: Kube-score generated manifests
env:
KUBE_SCORE: /tmp/bin/kube-score
run: .ci/scripts/kube-score.sh
chart-testing:
runs-on: ubuntu-latest
strategy:
matrix:
# Choose from https://hub.docker.com/r/kindest/node/tags
KubeVersion: [1.27.3, 1.28.0, 1.29.0]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# python is a requirement for the chart-testing action below (supports yamllint among other tests)
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config .ci/ct-config.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --config .ci/ct-config.yaml
- name: Create ${{matrix.KubeVersion}} kind cluster
uses: helm/[email protected]
with:
node_image: kindest/node:v${{matrix.KubeVersion}}
cluster_name: kubernetes-${{matrix.KubeVersion}}
if: steps.list-changed.outputs.changed == 'true'
- name: Run chart-testing (install) against ${{matrix.KubeVersion}}
run: ct install --config .ci/ct-config.yaml