13
13
GO_VERSION : 1.23.x
14
14
15
15
jobs :
16
+ build-deps :
17
+ runs-on : " ${{ matrix.runner }}"
18
+ timeout-minutes : 40
19
+ strategy :
20
+ fail-fast : false
21
+ matrix :
22
+ # ubuntu-20.04: cgroup v1, ubuntu-22.04 and later: cgroup v2
23
+ include :
24
+ - runner : ubuntu-24.04
25
+ containerd : v1.6.36
26
+ - runner : ubuntu-24.04
27
+ containerd : v1.7.23
28
+ - runner : ubuntu-24.04
29
+ containerd : v2.0.0-rc.5
30
+ - runner : github-arm64-2c-8gb
31
+ containerd : v2.0.0-rc.5
32
+ env :
33
+ CONTAINERD_VERSION : " ${{ matrix.containerd }}"
34
+ RUNNER : " ${{ matrix.runner }}"
35
+ steps :
36
+
37
+ with :
38
+ fetch-depth : 1
39
+ - name : Expose GitHub Runtime variables for gha
40
+ uses : crazy-max/ghaction-github-runtime@v3
41
+ - name : Enable containerd to be able to use gha cache
42
+ run : |
43
+ sudo mkdir -p /etc/docker
44
+ echo '{"features": {"containerd-snapshotter": true}}' | sudo tee /etc/docker/daemon.json
45
+ sudo systemctl restart docker
46
+ - name : " Prepare integration test environment"
47
+ run : |
48
+ docker build \
49
+ --cache-to type=gha,mode=max,scope=${RUNNER}-${CONTAINERD_VERSION} \
50
+ --cache-from type=gha,scope=${RUNNER}-${CONTAINERD_VERSION} \
51
+ --target build-deps --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
52
+
16
53
test-unit :
17
54
timeout-minutes : 5
18
55
name : unit | ${{ matrix.goos }}
51
88
run : go test -v ./pkg/...
52
89
53
90
test-integration :
91
+ needs : build-deps
54
92
runs-on : " ${{ matrix.runner }}"
55
93
timeout-minutes : 40
56
94
strategy :
@@ -71,14 +109,25 @@ jobs:
71
109
containerd : v2.0.0-rc.5
72
110
runner : github-arm64-2c-8gb
73
111
env :
74
- UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
75
112
CONTAINERD_VERSION : " ${{ matrix.containerd }}"
113
+ RUNNER : " ${{ matrix.runner }}"
114
+ UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
76
115
steps :
77
116
78
117
with :
79
118
fetch-depth : 1
119
+ - name : Expose GitHub Runtime variables for gha
120
+ uses : crazy-max/ghaction-github-runtime@v3
121
+ - name : Enable containerd to be able to use gha cache
122
+ run : |
123
+ sudo mkdir -p /etc/docker
124
+ echo '{"features": {"containerd-snapshotter": true}}' | sudo tee /etc/docker/daemon.json
125
+ sudo systemctl restart docker
80
126
- name : " Prepare integration test environment"
81
- run : docker build -t test-integration --target test-integration --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
127
+ run : |
128
+ docker build \
129
+ --cache-from type=gha,scope=${RUNNER}-${CONTAINERD_VERSION} \
130
+ -t test-integration --target test-integration --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
82
131
- name : " Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
83
132
run : |
84
133
sudo systemctl disable --now snapd.service snapd.socket
@@ -103,6 +152,7 @@ jobs:
103
152
command : docker run -t --rm --privileged test-integration
104
153
105
154
test-integration-ipv6 :
155
+ needs : build-deps
106
156
runs-on : " ubuntu-${{ matrix.ubuntu }}"
107
157
timeout-minutes : 40
108
158
strategy :
@@ -113,8 +163,9 @@ jobs:
113
163
- ubuntu : 24.04
114
164
containerd : v1.7.23
115
165
env :
116
- UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
117
166
CONTAINERD_VERSION : " ${{ matrix.containerd }}"
167
+ RUNNER : " ubuntu-${{ matrix.ubuntu }}"
168
+ UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
118
169
steps :
119
170
120
171
with :
@@ -123,13 +174,19 @@ jobs:
123
174
run : |
124
175
sudo sysctl -w net.ipv6.conf.all.forwarding=1
125
176
sudo sysctl -w net.ipv4.ip_forward=1
126
- - name : Enable IPv6 for Docker
177
+
178
+ - name : Expose GitHub Runtime variables for gha
179
+ uses : crazy-max/ghaction-github-runtime@v3
180
+ - name : Enable IPv6 for Docker and configure docker for gha
127
181
run : |
128
182
sudo mkdir -p /etc/docker
129
- echo '{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json
183
+ echo '{"features": {"containerd-snapshotter": true}, " ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json
130
184
sudo systemctl restart docker
131
185
- name : " Prepare integration test environment"
132
- run : docker build -t test-integration-ipv6 --target test-integration-ipv6 --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
186
+ run : |
187
+ docker build \
188
+ --cache-from type=gha,scope=${RUNNER}-${CONTAINERD_VERSION} \
189
+ -t test-integration-ipv6 --target test-integration-ipv6 --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
133
190
- name : " Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
134
191
run : |
135
192
sudo systemctl disable --now snapd.service snapd.socket
@@ -159,6 +216,7 @@ jobs:
159
216
command : docker run --network host -t --rm --privileged test-integration-ipv6
160
217
161
218
test-integration-rootless :
219
+ needs : build-deps
162
220
runs-on : " ubuntu-${{ matrix.ubuntu }}"
163
221
timeout-minutes : 60
164
222
strategy :
@@ -183,8 +241,9 @@ jobs:
183
241
rootlesskit : v2.3.1
184
242
target : test-integration-rootless-port-slirp4netns
185
243
env :
186
- UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
187
244
CONTAINERD_VERSION : " ${{ matrix.containerd }}"
245
+ RUNNER : " ubuntu-${{ matrix.ubuntu }}"
246
+ UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
188
247
ROOTLESSKIT_VERSION : " ${{ matrix.rootlesskit }}"
189
248
TEST_TARGET : " ${{ matrix.target }}"
190
249
steps :
@@ -215,8 +274,18 @@ jobs:
215
274
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
216
275
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
217
276
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
277
+ - name : Expose GitHub Runtime variables for gha
278
+ uses : crazy-max/ghaction-github-runtime@v3
279
+ - name : Enable containerd to be able to use gha cache
280
+ run : |
281
+ sudo mkdir -p /etc/docker
282
+ echo '{"features": {"containerd-snapshotter": true}}' | sudo tee /etc/docker/daemon.json
283
+ sudo systemctl restart docker
218
284
- 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} .
285
+ run : |
286
+ docker build \
287
+ --cache-from type=gha,scope=${RUNNER}-${CONTAINERD_VERSION} \
288
+ -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
289
- name : " Disable BuildKit for RootlessKit v1 (workaround for issue #622)"
221
290
run : |
222
291
# https://github.com/containerd/nerdctl/issues/622
0 commit comments