Skip to content

Commit 631b507

Browse files
ankitsny100mik
authored andcommitted
add latest version of k8s in GH action
Signed-off-by: Ankit Kumar <[email protected]>
1 parent 04fc9cc commit 631b507

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

.github/workflows/test-gh.yml

+19-4
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,29 @@ jobs:
1111
test-all:
1212
runs-on: ubuntu-latest
1313
strategy:
14+
fail-fast: false
15+
max-parallel: 2
1416
matrix:
15-
k8s-version: [1.27.0, 1.30.0, 1.31.0, 1.32.0]
17+
k8s-version: [v1.27.0, latest]
1618
steps:
17-
- name: Create kind cluster v${{matrix.k8s-version}}
19+
- name: install kind
1820
uses: helm/kind-action@v1
1921
with:
20-
node_image: kindest/node:v${{ matrix.k8s-version }}
21-
- name: Verify kind
22+
install_only: true
23+
- name: Resolve Kubernetes version
24+
id: resolve-k8s-version
25+
run: |
26+
k8s_version=${{ matrix.k8s-version }}
27+
if [ "${k8s_version}" = "latest" ]; then
28+
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)
29+
echo "Resolved latest k8s version to: $k8s_version"
30+
fi
31+
echo "k8s_version=$k8s_version" >> $GITHUB_ENV
32+
- name: Create Kind Cluster(k8s version ${{ env.k8s_version }})
33+
run: |
34+
k8s_version=${{ env.k8s_version }}
35+
kind create cluster --image kindest/node:${k8s_version}
36+
- name: Verify kind and k8s version
2237
run: |
2338
kind version
2439
kubectl version

0 commit comments

Comments
 (0)