Skip to content

1.30 support

1.30 support #364

Workflow file for this run

name: Test Modules
on:
push:
branches:
- main
- "release/**"
paths:
- "modules/*/*/base/**"
- "test/**"
pull_request:
permissions: {}
concurrency:
group: ci-tests-${{ github.ref }}
cancel-in-progress: true # cancels obsolete running jobs
jobs:
get-changed-modules:
name: "Build Changed Modules List"
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
any_changed: ${{ steps.changed-files.outputs.any_changed }}
matrix: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Calculate file differences
id: changed-files
uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c # v45.0.3
with:
dir_names: true
json: true
escape_json: false
dir_names_max_depth: 4
files: |
modules/*/*/base/**
test/**
test-module:
name: "Test"
if: needs.get-changed-modules.outputs.any_changed == 'true'
needs:
- get-changed-modules
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
versions:
- kind: kindest/node:v1.31.2@sha256:18fbefc20a7113353c7b75b5c869d7145a6abd6269154825872dc59c1329912e
kubectl: "v1.31.2"
- kind: kindest/node:v1.30.6@sha256:b6d08db72079ba5ae1f4a88a09025c0a904af3b52387643c285442afb05ab994
kubectl: "v1.30.6"
module: ${{ fromJSON(needs.get-changed-modules.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Kustomize Build
run: |
mkdir ci
kustomize build ${{ matrix.module }} > ci/rendered.yaml
- name: Create k8s Kind Cluster for Cilium
if: matrix.module == 'modules/cni/cilium/base'
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
with:
version: v0.25.0
# kubectl_version: "${{ matrix.versions.kubectl }}" uncomment whent new helm/kind-action version is available
node_image: "${{ matrix.versions.kind }}"
config: .github/workflows/kind-configs/no-cni.yaml
wait: 10s
- name: Create k8s Kind Cluster
if: matrix.module != 'modules/cni/cilium/base'
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
with:
version: v0.25.0
# kubectl_version: "${{ matrix.versions.kubectl }}" uncomment whent new helm/kind-action version is available
node_image: "${{ matrix.versions.kind }}"
config: .github/workflows/kind-configs/default.yaml
wait: 60s
- name: Install module
run: |
kubectl cluster-info
CRDS=$(yq eval-all 'select(.kind == "CustomResourceDefinition")' ci/rendered.yaml)
NON_CRDS=$(yq eval-all 'select(.kind != "CustomResourceDefinition")' ci/rendered.yaml)
if [ -n "${CRDS}" ] ; then
echo "Apply CRDs.."
kubectl create -f - <<< ${CRDS}
echo "Wait until all CRDs are available.."
kubectl wait --for condition=established crd $(yq eval-all 'select(.kind == "CustomResourceDefinition") | [ .metadata.name ] | join(" ")' ci/rendered.yaml )
fi
echo "Apply other resources.."
kubectl create -f - <<< ${NON_CRDS}
- name: Test - Rollout success
run: |
AWAITABLES="Deployment StatefulSet DaemonSet"
for KIND in ${AWAITABLES} ; do
NAMES=$(yq eval-all "select(.kind == \"${KIND}\") | [ .metadata.name ] | join(\" \")" ci/rendered.yaml)
for NAME in $NAMES ; do
kubectl -n $(yq eval-all "select(.kind == \"${KIND}\" and .metadata.name == \"${NAME}\") | .metadata.namespace" ci/rendered.yaml ) rollout status "${KIND}" --timeout 10m "${NAME}"
done
done
- name: Custom test script
if: startsWith( 'test/', ${{matrix.module}} )
run: |
[ ! -x ${{ matrix.module }}/test.sh ] && exit 0
${{ matrix.module }}/test.sh