Skip to content

Commit 223922b

Browse files
alicefrjlebon
authored andcommitted
ci: run e2e tests on multiple k8s versions
Introduce a new step 'supported-versions' for fetching the supported kubernetes versions. The versions are dynamically fetched from https://endoflife.date/api/kubernetes.json. The e2e job has a strategy fail-fast equal to false in this way, the parallel job run independently and the other aren't killed if one fails. Assisted-by: AI Signed-off-by: Alice Frosi <afrosi@redhat.com>
1 parent 5b9c4ff commit 223922b

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ concurrency:
1717
cancel-in-progress: true
1818

1919
jobs:
20+
supported-versions:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
matrix: ${{ steps.set-matrix.outputs.matrix }}
24+
steps:
25+
- name: Get supported Kubernetes versions
26+
id: set-matrix
27+
run: |
28+
MATRIX=$(curl -s https://endoflife.date/api/kubernetes.json | \
29+
jq -c '[.[] | select(.eol > (now | strftime("%Y-%m-%d"))) | .cycle][:3]')
30+
echo "matrix=${MATRIX}" >> "$GITHUB_OUTPUT"
31+
2032
unit:
2133
runs-on: ubuntu-latest
2234
permissions:
@@ -107,10 +119,16 @@ jobs:
107119

108120
e2e:
109121
runs-on: ubuntu-latest
110-
needs: [build-bink, build-operator]
122+
needs: [build-bink, build-operator, supported-versions]
111123
timeout-minutes: 30
112124
permissions:
113125
contents: read
126+
strategy:
127+
fail-fast: false
128+
matrix:
129+
kube-minor: ${{ fromJson(needs.supported-versions.outputs.matrix) }}
130+
env:
131+
BINK_NODE_DISK_IMAGE: ghcr.io/bootc-dev/bink/node:v${{ matrix.kube-minor }}-fedora-44-disk
114132
steps:
115133
- name: Checkout
116134
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -182,7 +200,7 @@ jobs:
182200
if: always()
183201
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
184202
with:
185-
name: e2e-logs
203+
name: e2e-logs-${{ matrix.kube-minor }}
186204
path: _output/logs/
187205
if-no-files-found: ignore
188206

0 commit comments

Comments
 (0)