Add job to test Helm chart using Kind
Signed-off-by: Marco Franssen <[email protected]>
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
kind: Cluster
|
||||||
|
apiVersion: kind.x-k8s.io/v1alpha4
|
||||||
|
kubeadmConfigPatches:
|
||||||
|
- |
|
||||||
|
apiVersion: kubeadm.k8s.io/v1beta2
|
||||||
|
kind: ClusterConfiguration
|
||||||
|
metadata:
|
||||||
|
name: config
|
||||||
|
apiServer:
|
||||||
|
extraArgs:
|
||||||
|
service-account-key-file: /etc/kubernetes/pki/sa.pub
|
||||||
|
service-account-signing-key-file: /etc/kubernetes/pki/sa.key
|
||||||
|
service-account-issuer: api,spire-agent
|
||||||
|
api-audiences: api,spire-server
|
||||||
|
# admission-control-config-file: /etc/kubernetes/pki/admctrl/admission-control.yaml
|
||||||
|
nodes:
|
||||||
|
- role: control-plane
|
||||||
@@ -6,11 +6,17 @@ on:
|
|||||||
- 'charts/**'
|
- 'charts/**'
|
||||||
- '.github/workflows/helm-chart-ci.yml'
|
- '.github/workflows/helm-chart-ci.yml'
|
||||||
- '.github/scripts/*.sh'
|
- '.github/scripts/*.sh'
|
||||||
|
- '.github/kind/conf/kind-config.yaml'
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.ref }}
|
group: ${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
HELM_VERSION: v3.10.2
|
||||||
|
PYTHON_VERSION: 3.11.1
|
||||||
|
CHART_TESTING_VERSION: v3.7.1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-docs:
|
check-docs:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
@@ -34,19 +40,86 @@ jobs:
|
|||||||
- name: Set up Helm
|
- name: Set up Helm
|
||||||
uses: azure/[email protected]
|
uses: azure/[email protected]
|
||||||
with:
|
with:
|
||||||
version: v3.10.2
|
version: ${{ env.HELM_VERSION }}
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.11.1
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
||||||
- name: Setup chart-testing
|
- name: Setup chart-testing
|
||||||
uses: helm/[email protected]
|
uses: helm/[email protected]
|
||||||
with:
|
with:
|
||||||
version: v3.7.1
|
version: ${{ env.CHART_TESTING_VERSION }}
|
||||||
|
|
||||||
|
- name: Run chart-testing (list-changed)
|
||||||
|
id: list-changed
|
||||||
|
run: |
|
||||||
|
changed=$(ct list-changed --target-branch main)
|
||||||
|
if [[ -n "$changed" ]]; then
|
||||||
|
echo "changed=true" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Run chart-testing (lint)
|
- name: Run chart-testing (lint)
|
||||||
run: |
|
run: |
|
||||||
ct lint --debug \
|
ct lint --debug \
|
||||||
--target-branch main
|
--target-branch main
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
changed: ${{ steps.list-changed.outputs.changed }}
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
needs:
|
||||||
|
- lint-chart
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
# Choose tags corresponding to the version of Kind being used.
|
||||||
|
# At a minimum, we should test the currently supported versions of
|
||||||
|
# Kubernetes, but can go back farther as long as we don't need heroics
|
||||||
|
# to pull it off (i.e. kubectl version juggling).
|
||||||
|
k8s:
|
||||||
|
- v1.25.3
|
||||||
|
- v1.24.7
|
||||||
|
- v1.23.13
|
||||||
|
- v1.22.15
|
||||||
|
- v1.21.14
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/[email protected]
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Helm
|
||||||
|
uses: azure/[email protected]
|
||||||
|
with:
|
||||||
|
version: ${{ env.HELM_VERSION }}
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
||||||
|
- name: Setup chart-testing
|
||||||
|
uses: helm/[email protected]
|
||||||
|
with:
|
||||||
|
version: ${{ env.CHART_TESTING_VERSION }}
|
||||||
|
|
||||||
|
- name: Create kind ${{ matrix.k8s }} cluster
|
||||||
|
uses: helm/[email protected]
|
||||||
|
# Only build a kind cluster if there are chart changes to test.
|
||||||
|
if: needs.lint-chart.outputs.changed == 'true'
|
||||||
|
with:
|
||||||
|
version: v0.17.0
|
||||||
|
node_image: kindest/node:${{ matrix.k8s }}
|
||||||
|
config: .github/kind/conf/kind-config.yaml
|
||||||
|
verbosity: 1
|
||||||
|
|
||||||
|
- name: Run chart-testing (install)
|
||||||
|
run: |
|
||||||
|
ct install --debug \
|
||||||
|
--target-branch main \
|
||||||
|
--exclude-deprecated
|
||||||
|
|||||||
Reference in New Issue
Block a user