@@ -154,7 +154,14 @@ jobs:
154154 name : driver-images-${{ matrix.driver_branch }}-${{ env.KERNEL_VERSION }}-${{ env.DIST }}
155155 path : ./driver-images-${{ matrix.driver_branch }}-${{ env.KERNEL_VERSION }}-${{ env.DIST }}.tar
156156 retention-days : 1
157-
157+
158+ - name : Upload kernel version as an artifact
159+ uses : actions/upload-artifact@v4
160+ with :
161+ name : kernel-version-${{ matrix.driver_branch }}-${{ env.KERNEL_VERSION }}-${{ env.DIST }}
162+ path : ./kernel-version-${{ matrix.driver_branch }}-${{ env.KERNEL_VERSION }}-${{ env.DIST }}.txt
163+ retention-days : 1
164+
158165 determine-e2e-test-matrix :
159166 runs-on : linux-amd64-cpu4
160167 strategy :
@@ -210,6 +217,80 @@ jobs:
210217 echo "matrix_values=$(cat $GITHUB_WORKSPACE/matrix_values.json | jq -c .)" >> $GITHUB_OUTPUT
211218 echo "matrix_values_not_empty=1" >> $GITHUB_OUTPUT
212219
220+ determine-e2e-test-matrix-first-release :
221+ runs-on : linux-amd64-cpu4
222+ if : ${{ needs.determine-e2e-test-matrix.outputs.matrix_values_not_empty == '0' }}
223+ strategy :
224+ matrix :
225+ dist : ${{ fromJson(needs.set-driver-version-matrix.outputs.dist) }}
226+ needs :
227+ - precompiled-build-image
228+ - set-driver-version-matrix
229+ outputs :
230+ matrix_values_not_empty : ${{ steps.set_kernel_version.outputs.matrix_values_not_empty }}
231+ matrix_values : ${{ steps.set_kernel_version.outputs.matrix_values }}
232+ dist : ${{ steps.set-driver-version-matrix.outputs.dist }}
233+ steps :
234+ - name : Check out code
235+ uses : actions/checkout@v4
236+ - name : Login to GitHub Container Registry
237+ uses : docker/login-action@v3
238+ with :
239+ registry : ghcr.io
240+ username : ${{ github.actor }}
241+ password : ${{ secrets.GITHUB_TOKEN }}
242+
243+ # download kernel version file for first release
244+ - name : Download kernel version artifact
245+ uses : actions/download-artifact@v4
246+ with :
247+ name : kernel-version-${{ matrix.driver_branch }}-${{ matrix.kernel_version }}-${{ matrix.dist }}
248+ path : ./
249+
250+ # download kernel version file for first release
251+ - name : Download kernel version artifact
252+ env :
253+ DIST : ${{ matrix.dist }}
254+ run : |
255+ artifacts=$(gh api -X GET /repos/${{ github.repository }}/actions/artifacts --jq '.artifacts[] | select(.name | endswith(env.DIST)) | .name')
256+ for artifact in $artifacts; do
257+ echo "Downloading kernel_version: $artifact"
258+ gh run download --name "$artifact" --dir ./
259+ done
260+
261+ - name : Set kernel version
262+ id : set_kernel_version
263+ env :
264+ DIST : ${{ matrix.dist }}
265+ run : |
266+ echo "matrix_values_not_empty=0" >> $GITHUB_OUTPUT
267+
268+ if [ "$DIST" == "ubuntu22.04" ]; then
269+ export BASE_TARGET="jammy"
270+ export LTS_KERNEL="5.15"
271+ elif [ "$DIST" == "ubuntu24.04" ]; then
272+ export BASE_TARGET="noble"
273+ export LTS_KERNEL="6.8"
274+ fi
275+
276+ kernel_flavors_json='${{ needs.set-driver-version-matrix.outputs.kernel_flavors }}'
277+ KERNEL_FLAVORS=($(echo "$kernel_flavors_json" | jq -r '.[]'))
278+ driver_branch_json='${{ needs.set-driver-version-matrix.outputs.driver_branch }}'
279+ DRIVER_BRANCHES=($(echo "$driver_branch_json" | jq -r '.[]'))
280+
281+ source ./tests/scripts/ci-precompiled-helpers.sh
282+ KERNEL_VERSIONS=($(get_kernel_versions_to_test $BASE_TARGET KERNEL_FLAVORS[@] DRIVER_BRANCHES[@] $DIST))
283+ if [ -z "$KERNEL_VERSIONS" ]; then
284+ # no new kernel release
285+ echo "Skipping e2e tests"
286+ exit 0
287+ fi
288+ # Convert array to JSON format and assign
289+ echo "[]" > $GITHUB_WORKSPACE/matrix_values.json
290+ printf '%s\n' "${KERNEL_VERSIONS[@]}" | jq -R . | jq -s . > $GITHUB_WORKSPACE/matrix_values.json
291+ echo "matrix_values=$(cat $GITHUB_WORKSPACE/matrix_values.json | jq -c .)" >> $GITHUB_OUTPUT
292+ echo "matrix_values_not_empty=1" >> $GITHUB_OUTPUT
293+
213294 e2e-tests-nvidiadriver :
214295 runs-on : linux-amd64-cpu4
215296 needs :
@@ -260,6 +341,14 @@ jobs:
260341 DRIVER_BRANCHES=($(echo "$driver_branch_json" | jq -r '.[]'))
261342 echo "DRIVER_BRANCHES=${DRIVER_BRANCHES[*]}" >> $GITHUB_ENV
262343
344+ # step added to skip azure e2e tests and publish the image
345+ # FIXME -- remove step once azure kernel upgrade starts working
346+ - name : Skip azure e2e
347+ if [[ "${KERNEL_VERSION}" == *-azure ]]; then
348+ echo "e2e test for azure flavor skipped, as kernel upgrade AWS => azure is not supported"
349+ exit 0
350+ fi
351+
263352 - name : Install GitHub CLI
264353 run : |
265354 sudo apt-get update
0 commit comments