@@ -429,6 +429,10 @@ jobs:
429429 matrix :
430430 mode : ["rootful", "rootless"]
431431 runs-on : ubuntu-24.04
432+ env :
433+ MODE : ${{ matrix.mode }}
434+ # FIXME: this is only necessary to access the build cache. To remove with build cleanup.
435+ CONTAINERD_VERSION : v2.0.3
432436 steps :
433437 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
434438 with :
@@ -490,20 +494,44 @@ jobs:
490494 echo "DOCKER_HOST=${DOCKER_HOST}" >>$GITHUB_ENV
491495 docker info
492496 docker version
497+ - name : " Expose GitHub Runtime variables for gha"
498+ uses : crazy-max/ghaction-github-runtime@b3a9207c0e1ef41f4cf215303c976869d0c2c1c4 # v3.0.0
493499 - name : " Prepare integration tests"
494- env :
495- MODE : ${{ matrix.mode }}
496500 run : |
497501 set -eux
498- TARGET=test-integration
499- [ "$MODE" = "rootless" ] && TARGET=test-integration-rootless
500- docker build -t test-integration --target "${TARGET}" .
501- # losetup not working as expected on EL8?
502- # > === FAIL: cmd/nerdctl/container TestRunDevice (0.44s)
503- # > container_run_cgroup_linux_test.go:236: assertion failed: error is not nil: loopback setup failed ([losetup --find --show /tmp/containerd-test-loopback3931357228]):
504- # > stdout="", stderr="losetup: /tmp/containerd-test-loopback3931357228: failed to set up loop device: No such file or directory\n": exit status 1
505- # https://github.com/containerd/nerdctl/pull/3904#issuecomment-2670917820
502+
506503 sudo losetup -Dv
507504 sudo losetup -lv
505+
506+ TARGET=test-integration
507+ [ "$MODE" = "rootless" ] && TARGET=test-integration-rootless
508+ docker buildx create --name with-gha --use
509+ docker buildx build \
510+ --output=type=docker \
511+ --cache-from type=gha,scope=amd64-${CONTAINERD_VERSION} \
512+ -t test-integration --target "${TARGET}" \
513+ .
514+
508515 - name : " Run integration tests"
509- run : docker run -t --rm --privileged test-integration
516+ # Presumably, something is broken with the way docker exposes /dev to the container, as it appears to only
517+ # randomly work. Mounting /dev does workaround the issue.
518+ # This might be due to the old kernel shipped with Alma (4.18), or something else between centos/docker.
519+ run : |
520+ set -eux
521+ [ "$MODE" = "rootless" ] && {
522+ echo "rootless"
523+ docker run -t -v /dev:/dev --rm --privileged test-integration /test-integration-rootless.sh ./hack/test-integration.sh -test.only-flaky=false
524+ } || {
525+ echo "rootful"
526+ docker run -t -v /dev:/dev --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=false
527+ }
528+ - name : " Run integration tests (flaky)"
529+ run : |
530+ set -eux
531+ [ "$MODE" = "rootless" ] && {
532+ echo "rootless"
533+ docker run -t -v /dev:/dev --rm --privileged test-integration /test-integration-rootless.sh ./hack/test-integration.sh -test.only-flaky=true
534+ } || {
535+ echo "rootful"
536+ docker run -t -v /dev:/dev --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=true
537+ }
0 commit comments