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 : " Enable containerd to be able to use gha cache"
49
+ run : |
50
+ sudo mkdir -p /etc/docker
51
+ echo '{"features": {"containerd-snapshotter": true}}' | sudo tee /etc/docker/daemon.json
52
+ sudo systemctl restart docker
53
+ - name : " Build dependencies for the integration test environment image"
54
+ run : |
55
+ docker build \
56
+ --cache-to type=gha,mode=max,scope=${ARCH}-${CONTAINERD_VERSION} \
57
+ --cache-from type=gha,scope=${ARCH}-${CONTAINERD_VERSION} \
58
+ --target build-dependencies --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
59
+
18
60
test-unit :
61
+ # FIXME:
19
62
# 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
63
# Apparently does not
21
64
# timeout-minutes: ${{ fromJSON(env.SHORT_TIMEOUT) }}
56
99
run : make test-unit
57
100
58
101
test-integration :
59
- timeout-minutes : 60
102
+ needs : build-dependencies
103
+ timeout-minutes : 30
60
104
name : rootful | ${{ matrix.containerd }} | ${{ matrix.runner }}
61
105
runs-on : " ${{ matrix.runner }}"
62
106
strategy :
@@ -67,24 +111,39 @@ jobs:
67
111
- ubuntu : 20.04
68
112
containerd : v1.6.36
69
113
runner : " ubuntu-20.04"
114
+ arch : amd64
70
115
- ubuntu : 22.04
71
116
containerd : v1.7.23
72
117
runner : " ubuntu-22.04"
118
+ arch : amd64
73
119
- ubuntu : 24.04
74
120
containerd : v2.0.0-rc.5
75
121
runner : " ubuntu-24.04"
122
+ arch : amd64
76
123
- ubuntu : 24.04
77
124
containerd : v2.0.0-rc.5
78
- runner : github-arm64-2c-8gb
125
+ runner : arm64-8core-32gb
126
+ arch : arm64
79
127
env :
80
- UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
81
128
CONTAINERD_VERSION : " ${{ matrix.containerd }}"
129
+ ARCH : " ${{ matrix.arch }}"
130
+ UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
82
131
steps :
83
132
84
133
with :
85
134
fetch-depth : 1
135
+ - name : " Expose GitHub Runtime variables for gha"
136
+ uses : crazy-max/ghaction-github-runtime@v3
137
+ - name : " Enable containerd to be able to use gha cache"
138
+ run : |
139
+ sudo mkdir -p /etc/docker
140
+ echo '{"features": {"containerd-snapshotter": true}}' | sudo tee /etc/docker/daemon.json
141
+ sudo systemctl restart docker
86
142
- 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} .
143
+ run : |
144
+ docker build \
145
+ --cache-from type=gha,scope=${ARCH}-${CONTAINERD_VERSION} \
146
+ -t test-integration --target test-integration --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
88
147
- name : " Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
89
148
run : |
90
149
sudo systemctl disable --now snapd.service snapd.socket
@@ -106,19 +165,22 @@ jobs:
106
165
run : docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=true
107
166
108
167
test-integration-ipv6 :
109
- timeout-minutes : 60
168
+ needs : build-dependencies
169
+ timeout-minutes : 10
110
170
name : ipv6 | ${{ matrix.containerd }} | ${{ matrix.ubuntu }}
111
171
runs-on : " ubuntu-${{ matrix.ubuntu }}"
112
172
strategy :
113
173
fail-fast : false
114
174
matrix :
115
- # ubuntu-20.04: cgroup v1, ubuntu-22.04 and later: cgroup v2
116
175
include :
117
176
- ubuntu : 24.04
118
177
containerd : v2.0.0-rc.5
178
+ arch : amd64
119
179
env :
120
- UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
121
180
CONTAINERD_VERSION : " ${{ matrix.containerd }}"
181
+ ARCH : " ${{ matrix.arch }}"
182
+ RUNNER : " ubuntu-${{ matrix.ubuntu }}"
183
+ UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
122
184
steps :
123
185
124
186
with :
@@ -127,13 +189,18 @@ jobs:
127
189
run : |
128
190
sudo sysctl -w net.ipv6.conf.all.forwarding=1
129
191
sudo sysctl -w net.ipv4.ip_forward=1
130
- - name : Enable IPv6 for Docker
192
+ - name : " Expose GitHub Runtime variables for gha"
193
+ uses : crazy-max/ghaction-github-runtime@v3
194
+ - name : Enable IPv6 for Docker, and configure docker to use containerd for gha
131
195
run : |
132
196
sudo mkdir -p /etc/docker
133
- echo '{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json
197
+ echo '{"features": {"containerd-snapshotter": true}, " ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json
134
198
sudo systemctl restart docker
135
199
- 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} .
200
+ run : |
201
+ docker build \
202
+ --cache-from type=gha,scope=${ARCH}-${CONTAINERD_VERSION} \
203
+ -t test-integration --target test-integration --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
137
204
- name : " Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
138
205
run : |
139
206
sudo systemctl disable --now snapd.service snapd.socket
@@ -158,7 +225,8 @@ jobs:
158
225
run : docker run --network host -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-ipv6
159
226
160
227
test-integration-rootless :
161
- timeout-minutes : 60
228
+ needs : build-dependencies
229
+ timeout-minutes : 30
162
230
name : " ${{ matrix.target }} | ${{ matrix.containerd }} | ${{ matrix.rootlesskit }} | ${{ matrix.ubuntu }}"
163
231
runs-on : " ubuntu-${{ matrix.ubuntu }}"
164
232
strategy :
@@ -170,21 +238,27 @@ jobs:
170
238
containerd : v1.6.36
171
239
rootlesskit : v1.1.1 # Deprecated
172
240
target : rootless
241
+ arch : amd64
173
242
- ubuntu : 22.04
174
243
containerd : v1.7.23
175
244
rootlesskit : v2.3.1
176
245
target : rootless
246
+ arch : amd64
177
247
- ubuntu : 24.04
178
248
containerd : v2.0.0-rc.5
179
249
rootlesskit : v2.3.1
180
250
target : rootless
251
+ arch : amd64
181
252
- ubuntu : 24.04
182
253
containerd : v1.7.23
183
254
rootlesskit : v2.3.1
184
255
target : rootless-port-slirp4netns
256
+ arch : amd64
185
257
env :
186
- UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
187
258
CONTAINERD_VERSION : " ${{ matrix.containerd }}"
259
+ ARCH : " ${{ matrix.arch }}"
260
+ RUNNER : " ubuntu-${{ matrix.ubuntu }}"
261
+ UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
188
262
ROOTLESSKIT_VERSION : " ${{ matrix.rootlesskit }}"
189
263
TEST_TARGET : " test-integration-${{ matrix.target }}"
190
264
steps :
@@ -215,8 +289,18 @@ jobs:
215
289
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
216
290
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
217
291
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
292
+ - name : " Expose GitHub Runtime variables for gha"
293
+ uses : crazy-max/ghaction-github-runtime@v3
294
+ - name : " Enable containerd to be able to use gha cache"
295
+ run : |
296
+ sudo mkdir -p /etc/docker
297
+ echo '{"features": {"containerd-snapshotter": true}}' | sudo tee /etc/docker/daemon.json
298
+ sudo systemctl restart docker
218
299
- 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} .
300
+ run : |
301
+ docker build \
302
+ --cache-from type=gha,scope=${ARCH}-${CONTAINERD_VERSION} \
303
+ -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
304
- name : " Disable BuildKit for RootlessKit v1 (workaround for issue #622)"
221
305
run : |
222
306
# https://github.com/containerd/nerdctl/issues/622
@@ -250,7 +334,7 @@ jobs:
250
334
run : GO_VERSION="$(echo ${{ matrix.go-version }} | sed -e s/.x//)" make binaries
251
335
252
336
test-integration-docker-compatibility :
253
- timeout-minutes : 60
337
+ timeout-minutes : 30
254
338
name : docker
255
339
runs-on : ubuntu-24.04
256
340
steps :
@@ -262,11 +346,6 @@ jobs:
262
346
go-version : ${{ env.GO_VERSION }}
263
347
cache : true
264
348
check-latest : true
265
- - name : " Print docker info"
266
- run : |
267
- set -eux -o pipefail
268
- docker info
269
- docker version
270
349
- name : " Register QEMU (tonistiigi/binfmt)"
271
350
run : |
272
351
# `--install all` will only install emulation for architectures that cannot be natively executed
@@ -324,13 +403,14 @@ jobs:
324
403
run : ./hack/test-integration.sh -test.only-flaky=true
325
404
326
405
test-integration-freebsd :
327
- timeout-minutes : 60
406
+ timeout-minutes : 30
328
407
name : FreeBSD
329
408
# ubuntu-24.04 lacks the vagrant package
330
409
runs-on : ubuntu-22.04
331
-
332
410
steps :
333
411
412
+ with :
413
+ fetch-depth : 1
334
414
- uses : actions/cache@v4
335
415
with :
336
416
path : /root/.vagrant.d
0 commit comments