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