1515 LONG_TIMEOUT : 60
1616
1717jobs :
18+ # This job builds the dependency target of the test docker image for all supported architectures and cache it in GHA
19+ build-dependencies :
20+ timeout-minutes : 10
21+ name : dependencies | ${{ matrix.containerd }} | ${{ matrix.arch }}
22+ runs-on : " ${{ matrix.runner }}"
23+ strategy :
24+ fail-fast : false
25+ matrix :
26+ include :
27+ - runner : ubuntu-24.04
28+ containerd : v1.6.36
29+ arch : amd64
30+ - runner : ubuntu-24.04
31+ containerd : v1.7.23
32+ arch : amd64
33+ - runner : ubuntu-24.04
34+ containerd : v2.0.0-rc.5
35+ arch : amd64
36+ - runner : arm64-8core-32gb
37+ containerd : v2.0.0-rc.5
38+ arch : arm64
39+ env :
40+ CONTAINERD_VERSION : " ${{ matrix.containerd }}"
41+ ARCH : " ${{ matrix.arch }}"
42+ steps :
43+ - uses : actions/checkout@v4.2.1
44+ with :
45+ fetch-depth : 1
46+ - name : " Expose GitHub Runtime variables for gha"
47+ uses : crazy-max/ghaction-github-runtime@v3
48+ - name : " Build dependencies for the integration test environment image"
49+ run : |
50+ docker buildx create --name with-gha --use
51+ docker buildx build \
52+ --output=type=docker \
53+ --cache-to type=gha,mode=max,scope=${ARCH}-${CONTAINERD_VERSION} \
54+ --cache-from type=gha,scope=${ARCH}-${CONTAINERD_VERSION} \
55+ --target build-dependencies --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
56+
1857 test-unit :
58+ # FIXME:
1959 # Supposed to work: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#example-returning-a-json-data-type
2060 # Apparently does not
2161 # timeout-minutes: ${{ fromJSON(env.SHORT_TIMEOUT) }}
5696 run : make test-unit
5797
5898 test-integration :
59- timeout-minutes : 60
99+ needs : build-dependencies
100+ timeout-minutes : 30
60101 name : rootful | ${{ matrix.containerd }} | ${{ matrix.runner }}
61102 runs-on : " ${{ matrix.runner }}"
62103 strategy :
@@ -67,24 +108,36 @@ jobs:
67108 - ubuntu : 20.04
68109 containerd : v1.6.36
69110 runner : " ubuntu-20.04"
111+ arch : amd64
70112 - ubuntu : 22.04
71113 containerd : v1.7.23
72114 runner : " ubuntu-22.04"
115+ arch : amd64
73116 - ubuntu : 24.04
74117 containerd : v2.0.0-rc.5
75118 runner : " ubuntu-24.04"
119+ arch : amd64
76120 - ubuntu : 24.04
77121 containerd : v2.0.0-rc.5
78- runner : github-arm64-2c-8gb
122+ runner : arm64-8core-32gb
123+ arch : arm64
79124 env :
80- UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
81125 CONTAINERD_VERSION : " ${{ matrix.containerd }}"
126+ ARCH : " ${{ matrix.arch }}"
127+ UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
82128 steps :
83129 - uses : actions/checkout@v4.2.2
84130 with :
85131 fetch-depth : 1
132+ - name : " Expose GitHub Runtime variables for gha"
133+ uses : crazy-max/ghaction-github-runtime@v3
86134 - name : " Prepare integration test environment"
87- run : docker build -t test-integration --target test-integration --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
135+ run : |
136+ docker buildx create --name with-gha --use
137+ docker buildx build \
138+ --output=type=docker \
139+ --cache-from type=gha,scope=${ARCH}-${CONTAINERD_VERSION} \
140+ -t test-integration --target test-integration --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
88141 - name : " Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
89142 run : |
90143 sudo systemctl disable --now snapd.service snapd.socket
@@ -106,19 +159,21 @@ jobs:
106159 run : docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=true
107160
108161 test-integration-ipv6 :
109- timeout-minutes : 60
162+ needs : build-dependencies
163+ timeout-minutes : 10
110164 name : ipv6 | ${{ matrix.containerd }} | ${{ matrix.ubuntu }}
111165 runs-on : " ubuntu-${{ matrix.ubuntu }}"
112166 strategy :
113167 fail-fast : false
114168 matrix :
115- # ubuntu-20.04: cgroup v1, ubuntu-22.04 and later: cgroup v2
116169 include :
117170 - ubuntu : 24.04
118171 containerd : v2.0.0-rc.5
172+ arch : amd64
119173 env :
120- UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
121174 CONTAINERD_VERSION : " ${{ matrix.containerd }}"
175+ ARCH : " ${{ matrix.arch }}"
176+ UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
122177 steps :
123178 - uses : actions/checkout@v4.2.2
124179 with :
@@ -127,13 +182,20 @@ jobs:
127182 run : |
128183 sudo sysctl -w net.ipv6.conf.all.forwarding=1
129184 sudo sysctl -w net.ipv4.ip_forward=1
130- - name : Enable IPv6 for Docker
185+ - name : " Expose GitHub Runtime variables for gha"
186+ uses : crazy-max/ghaction-github-runtime@v3
187+ - name : Enable IPv6 for Docker, and configure docker to use containerd for gha
131188 run : |
132189 sudo mkdir -p /etc/docker
133190 echo '{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json
134191 sudo systemctl restart docker
135192 - name : " Prepare integration test environment"
136- run : docker build -t test-integration --target test-integration --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
193+ run : |
194+ docker buildx create --name with-gha --use
195+ docker buildx build \
196+ --output=type=docker \
197+ --cache-from type=gha,scope=${ARCH}-${CONTAINERD_VERSION} \
198+ -t test-integration --target test-integration --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
137199 - name : " Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
138200 run : |
139201 sudo systemctl disable --now snapd.service snapd.socket
@@ -158,7 +220,8 @@ jobs:
158220 run : docker run --network host -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-ipv6
159221
160222 test-integration-rootless :
161- timeout-minutes : 60
223+ needs : build-dependencies
224+ timeout-minutes : 30
162225 name : " ${{ matrix.target }} | ${{ matrix.containerd }} | ${{ matrix.rootlesskit }} | ${{ matrix.ubuntu }}"
163226 runs-on : " ubuntu-${{ matrix.ubuntu }}"
164227 strategy :
@@ -170,21 +233,26 @@ jobs:
170233 containerd : v1.6.36
171234 rootlesskit : v1.1.1 # Deprecated
172235 target : rootless
236+ arch : amd64
173237 - ubuntu : 22.04
174238 containerd : v1.7.23
175239 rootlesskit : v2.3.1
176240 target : rootless
241+ arch : amd64
177242 - ubuntu : 24.04
178243 containerd : v2.0.0-rc.5
179244 rootlesskit : v2.3.1
180245 target : rootless
246+ arch : amd64
181247 - ubuntu : 24.04
182248 containerd : v1.7.23
183249 rootlesskit : v2.3.1
184250 target : rootless-port-slirp4netns
251+ arch : amd64
185252 env :
186- UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
187253 CONTAINERD_VERSION : " ${{ matrix.containerd }}"
254+ ARCH : " ${{ matrix.arch }}"
255+ UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
188256 ROOTLESSKIT_VERSION : " ${{ matrix.rootlesskit }}"
189257 TEST_TARGET : " test-integration-${{ matrix.target }}"
190258 steps :
@@ -215,8 +283,15 @@ jobs:
215283 docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
216284 docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
217285 docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
286+ - name : " Expose GitHub Runtime variables for gha"
287+ uses : crazy-max/ghaction-github-runtime@v3
218288 - name : " Prepare (network driver=slirp4netns, port driver=builtin)"
219- run : docker build -t ${TEST_TARGET} --target ${TEST_TARGET} --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} --build-arg ROOTLESSKIT_VERSION=${ROOTLESSKIT_VERSION} .
289+ run : |
290+ docker buildx create --name with-gha --use
291+ docker buildx build \
292+ --output=type=docker \
293+ --cache-from type=gha,scope=${ARCH}-${CONTAINERD_VERSION} \
294+ -t ${TEST_TARGET} --target ${TEST_TARGET} --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} --build-arg ROOTLESSKIT_VERSION=${ROOTLESSKIT_VERSION} .
220295 - name : " Disable BuildKit for RootlessKit v1 (workaround for issue #622)"
221296 run : |
222297 # https://github.com/containerd/nerdctl/issues/622
@@ -250,7 +325,7 @@ jobs:
250325 run : GO_VERSION="$(echo ${{ matrix.go-version }} | sed -e s/.x//)" make binaries
251326
252327 test-integration-docker-compatibility :
253- timeout-minutes : 60
328+ timeout-minutes : 30
254329 name : docker
255330 runs-on : ubuntu-24.04
256331 steps :
@@ -262,11 +337,6 @@ jobs:
262337 go-version : ${{ env.GO_VERSION }}
263338 cache : true
264339 check-latest : true
265- - name : " Print docker info"
266- run : |
267- set -eux -o pipefail
268- docker info
269- docker version
270340 - name : " Register QEMU (tonistiigi/binfmt)"
271341 run : |
272342 # `--install all` will only install emulation for architectures that cannot be natively executed
@@ -324,13 +394,14 @@ jobs:
324394 run : ./hack/test-integration.sh -test.only-flaky=true
325395
326396 test-integration-freebsd :
327- timeout-minutes : 60
397+ timeout-minutes : 30
328398 name : FreeBSD
329399 # ubuntu-24.04 lacks the vagrant package
330400 runs-on : ubuntu-22.04
331-
332401 steps :
333402 - uses : actions/checkout@v4.2.2
403+ with :
404+ fetch-depth : 1
334405 - uses : actions/cache@v4
335406 with :
336407 path : /root/.vagrant.d
0 commit comments