Skip to content

Commit

Permalink
add latest version of k8s in GH action
Browse files Browse the repository at this point in the history
Signed-off-by: Ankit Kumar <ankit-ak.kumar@broadcom.com>
  • Loading branch information
ankitsny committed Jan 27, 2025
1 parent 9512c07 commit 87d5512
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/test-gh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,26 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
k8s-version: [1.27.0, 1.30.0, 1.31.0, 1.32.0]
k8s-version: [v1.27.0, v1.31.0, latest]
steps:
- name: Create kind cluster v${{matrix.k8s-version}}
- name: install kind
uses: helm/kind-action@v1
with:
node_image: kindest/node:v${{ matrix.k8s-version }}
- name: Verify kind
install_only: true
- name: Resolve Kubernetes version
id: resolve-k8s-version
run: |
k8s_version=${{ matrix.k8s-version }}
if [ "${k8s_version}" = "latest" ]; then
k8s_version=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/kubernetes/kubernetes/releases/latest | grep -oE 'tag/v[0-9]+\.[0-9]+\.[0-9]+' | cut -d'/' -f2)
echo "Resolved latest k8s version to: $k8s_version"
fi
echo "::set-output name=k8s_version::$k8s_version"
- name: Create Kind Cluster(k8s version ${{ steps.resolve-k8s-version.outputs.k8s_version }})
run: |
k8s_version=${{ steps.resolve-k8s-version.outputs.k8s_version }}
kind create cluster --image kindest/node:${k8s_version}
- name: Verify kind and k8s version
run: |
kind version
kubectl version
Expand Down

0 comments on commit 87d5512

Please sign in to comment.