@@ -15,19 +15,29 @@ jobs:
15
15
get_version_matrix :
16
16
runs-on : ubuntu-latest
17
17
steps :
18
- - uses : actions/checkout@v4
18
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19
+ - uses : imjasonh/setup-crane@31b88efe9de28ae0ffa220711af4b60be9435f6e # v0.4
19
20
- id : get_version_matrix
20
21
shell : bash
21
- run : scripts/get-version-matrix.sh
22
+ run : |
23
+ set -euo pipefail
24
+
25
+ k8s_cycles="$(curl -sSfL https://endoflife.date/api/kubernetes.json | jq -rc '[sort_by(.releaseDate) | reverse | .[0:4] | .[].cycle]')"
26
+ kind_versions="$(crane ls docker.io/kindest/node | jq -sRrc --argjson cycles "${k8s_cycles}" 'split("\n") | [.[] | match("^v((\\d+\\.\\d+)\\.\\d+)$").captures | {cycle: .[1].string, version: .[0].string}] | group_by(.cycle) | [.[] | .[-1] | {(.cycle): {"version": .version}}] | reduce .[] as $item ({}; . *= $item) | . as $versions | [$cycles | .[] | $versions[.].version]')"
27
+
28
+ {
29
+ echo "terraform_versions=$(curl -sSfL https://endoflife.date/api/terraform.json | jq -rc '[sort_by(.releaseDate) | reverse | .[0:4] | .[].latest] + ["1.5.7"]')"
30
+ echo "k8s_versions=${kind_versions}"
31
+ } >> "${GITHUB_OUTPUT}"
22
32
outputs :
23
33
terraform_versions : ${{ steps.get_version_matrix.outputs.terraform_versions }}
24
34
k8s_versions : ${{ steps.get_version_matrix.outputs.k8s_versions }}
25
35
unit_test :
26
36
runs-on : ubuntu-latest
27
37
steps :
28
- - uses : actions/checkout@master
38
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29
39
- name : Set up Go
30
- uses : actions/setup-go@v5
40
+ uses : actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
31
41
with :
32
42
go-version-file : go.mod
33
43
- name : Unit tests
@@ -47,12 +57,12 @@ jobs:
47
57
terraform_version : ${{ fromJson(needs.get_version_matrix.outputs.terraform_versions) }}
48
58
k8s_version : ${{ fromJson(needs.get_version_matrix.outputs.k8s_versions) }}
49
59
steps :
50
- - uses : actions/checkout@v4
60
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
51
61
- name : Set up Go
52
- uses : actions/setup-go@v5
62
+ uses : actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
53
63
with :
54
64
go-version-file : go.mod
55
-
65
+ - uses : helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
56
66
id : kind
57
67
with :
58
68
wait : 2m
0 commit comments