Release 7.1.x #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and Test Charts | |
on: pull_request | |
jobs: | |
chart-testing: | |
name: Lint and Test kubernetes ${{ matrix.kubernetesVersion }} | |
strategy: | |
fail-fast: false | |
matrix: | |
kubernetesVersion: [ | |
"v1.28.0", | |
"v1.29.8", | |
"v1.30.4", | |
"v1.31.0" | |
] | |
runs-on: ubuntu-latest | |
if: github.ref != 'refs/heads/main' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: v3.12.1 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- 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 --target-branch ${{ github.event.repository.default_branch }}) | |
if [[ -n "$changed" ]]; then | |
echo "changed=true" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Run chart-testing (lint) | |
if: steps.list-changed.outputs.changed == 'true' | |
run: ct lint --target-branch ${{ github.event.repository.default_branch }} --config ct.yaml | |
- name: Create kind cluster | |
if: steps.list-changed.outputs.changed == 'true' | |
uses: helm/kind-action@v1.10.0 | |
with: | |
node_image: "kindest/node:${{ matrix.kubernetesVersion }}" | |
- name: Verify kind | |
run: | | |
kubectl cluster-info | |
kubectl get nodes -o wide | |
kubectl get pods -n kube-system | |
# Only build a kind cluster if there are chart changes to test. | |
if: steps.list-changed.outputs.changed == 'true' | |
- name: Run chart-testing (install) | |
run: ct install --config ct.yaml |