15
15
LONG_TIMEOUT : 60
16
16
17
17
jobs :
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
+
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
+
18
57
test-unit :
58
+ # FIXME:
19
59
# 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
20
60
# Apparently does not
21
61
# timeout-minutes: ${{ fromJSON(env.SHORT_TIMEOUT) }}
56
96
run : make test-unit
57
97
58
98
test-integration :
59
- timeout-minutes : 60
99
+ needs : build-dependencies
100
+ timeout-minutes : 30
60
101
name : rootful | ${{ matrix.containerd }} | ${{ matrix.runner }}
61
102
runs-on : " ${{ matrix.runner }}"
62
103
strategy :
@@ -67,24 +108,36 @@ jobs:
67
108
- ubuntu : 20.04
68
109
containerd : v1.6.36
69
110
runner : " ubuntu-20.04"
111
+ arch : amd64
70
112
- ubuntu : 22.04
71
113
containerd : v1.7.23
72
114
runner : " ubuntu-22.04"
115
+ arch : amd64
73
116
- ubuntu : 24.04
74
117
containerd : v2.0.0-rc.5
75
118
runner : " ubuntu-24.04"
119
+ arch : amd64
76
120
- ubuntu : 24.04
77
121
containerd : v2.0.0-rc.5
78
- runner : github-arm64-2c-8gb
122
+ runner : arm64-8core-32gb
123
+ arch : arm64
79
124
env :
80
- UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
81
125
CONTAINERD_VERSION : " ${{ matrix.containerd }}"
126
+ ARCH : " ${{ matrix.arch }}"
127
+ UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
82
128
steps :
83
129
84
130
with :
85
131
fetch-depth : 1
132
+ - name : " Expose GitHub Runtime variables for gha"
133
+ uses : crazy-max/ghaction-github-runtime@v3
86
134
- 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} .
88
141
- name : " Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
89
142
run : |
90
143
sudo systemctl disable --now snapd.service snapd.socket
@@ -106,19 +159,21 @@ jobs:
106
159
run : docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=true
107
160
108
161
test-integration-ipv6 :
109
- timeout-minutes : 60
162
+ needs : build-dependencies
163
+ timeout-minutes : 10
110
164
name : ipv6 | ${{ matrix.containerd }} | ${{ matrix.ubuntu }}
111
165
runs-on : " ubuntu-${{ matrix.ubuntu }}"
112
166
strategy :
113
167
fail-fast : false
114
168
matrix :
115
- # ubuntu-20.04: cgroup v1, ubuntu-22.04 and later: cgroup v2
116
169
include :
117
170
- ubuntu : 24.04
118
171
containerd : v2.0.0-rc.5
172
+ arch : amd64
119
173
env :
120
- UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
121
174
CONTAINERD_VERSION : " ${{ matrix.containerd }}"
175
+ ARCH : " ${{ matrix.arch }}"
176
+ UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
122
177
steps :
123
178
124
179
with :
@@ -127,13 +182,20 @@ jobs:
127
182
run : |
128
183
sudo sysctl -w net.ipv6.conf.all.forwarding=1
129
184
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
131
188
run : |
132
189
sudo mkdir -p /etc/docker
133
190
echo '{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json
134
191
sudo systemctl restart docker
135
192
- 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} .
137
199
- name : " Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
138
200
run : |
139
201
sudo systemctl disable --now snapd.service snapd.socket
@@ -158,7 +220,8 @@ jobs:
158
220
run : docker run --network host -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-ipv6
159
221
160
222
test-integration-rootless :
161
- timeout-minutes : 60
223
+ needs : build-dependencies
224
+ timeout-minutes : 30
162
225
name : " ${{ matrix.target }} | ${{ matrix.containerd }} | ${{ matrix.rootlesskit }} | ${{ matrix.ubuntu }}"
163
226
runs-on : " ubuntu-${{ matrix.ubuntu }}"
164
227
strategy :
@@ -170,21 +233,26 @@ jobs:
170
233
containerd : v1.6.36
171
234
rootlesskit : v1.1.1 # Deprecated
172
235
target : rootless
236
+ arch : amd64
173
237
- ubuntu : 22.04
174
238
containerd : v1.7.23
175
239
rootlesskit : v2.3.1
176
240
target : rootless
241
+ arch : amd64
177
242
- ubuntu : 24.04
178
243
containerd : v2.0.0-rc.5
179
244
rootlesskit : v2.3.1
180
245
target : rootless
246
+ arch : amd64
181
247
- ubuntu : 24.04
182
248
containerd : v1.7.23
183
249
rootlesskit : v2.3.1
184
250
target : rootless-port-slirp4netns
251
+ arch : amd64
185
252
env :
186
- UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
187
253
CONTAINERD_VERSION : " ${{ matrix.containerd }}"
254
+ ARCH : " ${{ matrix.arch }}"
255
+ UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
188
256
ROOTLESSKIT_VERSION : " ${{ matrix.rootlesskit }}"
189
257
TEST_TARGET : " test-integration-${{ matrix.target }}"
190
258
steps :
@@ -215,8 +283,15 @@ jobs:
215
283
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
216
284
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
217
285
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
218
288
- 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} .
220
295
- name : " Disable BuildKit for RootlessKit v1 (workaround for issue #622)"
221
296
run : |
222
297
# https://github.com/containerd/nerdctl/issues/622
@@ -250,7 +325,7 @@ jobs:
250
325
run : GO_VERSION="$(echo ${{ matrix.go-version }} | sed -e s/.x//)" make binaries
251
326
252
327
test-integration-docker-compatibility :
253
- timeout-minutes : 60
328
+ timeout-minutes : 30
254
329
name : docker
255
330
runs-on : ubuntu-24.04
256
331
steps :
@@ -262,11 +337,6 @@ jobs:
262
337
go-version : ${{ env.GO_VERSION }}
263
338
cache : true
264
339
check-latest : true
265
- - name : " Print docker info"
266
- run : |
267
- set -eux -o pipefail
268
- docker info
269
- docker version
270
340
- name : " Register QEMU (tonistiigi/binfmt)"
271
341
run : |
272
342
# `--install all` will only install emulation for architectures that cannot be natively executed
@@ -324,13 +394,14 @@ jobs:
324
394
run : ./hack/test-integration.sh -test.only-flaky=true
325
395
326
396
test-integration-freebsd :
327
- timeout-minutes : 60
397
+ timeout-minutes : 30
328
398
name : FreeBSD
329
399
# ubuntu-24.04 lacks the vagrant package
330
400
runs-on : ubuntu-22.04
331
-
332
401
steps :
333
402
403
+ with :
404
+ fetch-depth : 1
334
405
- uses : actions/cache@v4
335
406
with :
336
407
path : /root/.vagrant.d
0 commit comments