1111
1212env :
1313 GO_VERSION : 1.23.x
14+ SHORT_TIMEOUT : 5
15+ LONG_TIMEOUT : 60
1416
1517jobs :
1618 test-unit :
19+ # 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+ # Apparently does not
21+ # timeout-minutes: ${{ fromJSON(env.SHORT_TIMEOUT) }}
1722 timeout-minutes : 5
1823 name : unit | ${{ matrix.goos }}
1924 runs-on : " ${{ matrix.os }}"
@@ -48,11 +53,12 @@ jobs:
4853 working-directory : containerd
4954 run : GOPATH=$(go env GOPATH) script/setup/install-cni-windows
5055 - name : " Run unit tests"
51- run : go test -v ./pkg/...
56+ run : make test-unit
5257
5358 test-integration :
59+ timeout-minutes : 60
60+ name : rootful | ${{ matrix.containerd }} | ${{ matrix.runner }}
5461 runs-on : " ${{ matrix.runner }}"
55- timeout-minutes : 40
5662 strategy :
5763 fail-fast : false
5864 matrix :
@@ -95,23 +101,21 @@ jobs:
95101 docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
96102 docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
97103 - name : " Run integration tests"
98- uses : nick-fields/retry@v3
99- with :
100- timeout_minutes : 30
101- max_attempts : 2
102- retry_on : error
103- command : docker run -t --rm --privileged test-integration
104+ run : docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=false
105+ - name : " Run integration tests (flaky)"
106+ run : docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=true
104107
105108 test-integration-ipv6 :
109+ timeout-minutes : 60
110+ name : ipv6 | ${{ matrix.containerd }} | ${{ matrix.ubuntu }}
106111 runs-on : " ubuntu-${{ matrix.ubuntu }}"
107- timeout-minutes : 40
108112 strategy :
109113 fail-fast : false
110114 matrix :
111115 # ubuntu-20.04: cgroup v1, ubuntu-22.04 and later: cgroup v2
112116 include :
113117 - ubuntu : 24.04
114- containerd : v1.7.23
118+ containerd : v2.0.0-rc.5
115119 env :
116120 UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
117121 CONTAINERD_VERSION : " ${{ matrix.containerd }}"
@@ -129,7 +133,7 @@ jobs:
129133 echo '{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json
130134 sudo systemctl restart docker
131135 - 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} .
136+ run : docker build -t test-integration --target test-integration --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
133137 - name : " Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
134138 run : |
135139 sudo systemctl disable --now snapd.service snapd.socket
@@ -147,20 +151,16 @@ jobs:
147151 docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
148152 - name : " Run integration tests"
149153 # The nested IPv6 network inside docker and qemu is complex and needs a bunch of sysctl config.
150- # Therefore it's hard to debug why the IPv6 tests fail in such an isolation layer.
154+ # Therefore, it's hard to debug why the IPv6 tests fail in such an isolation layer.
151155 # On the other side, using the host network is easier at configuration.
152156 # Besides, each job is running on a different instance, which means using host network here
153157 # is safe and has no side effects on others.
154- uses : nick-fields/retry@v3
155- with :
156- timeout_minutes : 30
157- max_attempts : 2
158- retry_on : error
159- command : docker run --network host -t --rm --privileged test-integration-ipv6
158+ run : docker run --network host -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-ipv6
160159
161160 test-integration-rootless :
162- runs-on : " ubuntu-${{ matrix.ubuntu }}"
163161 timeout-minutes : 60
162+ name : " ${{ matrix.target }} | ${{ matrix.containerd }} | ${{ matrix.rootlesskit }} | ${{ matrix.ubuntu }}"
163+ runs-on : " ubuntu-${{ matrix.ubuntu }}"
164164 strategy :
165165 fail-fast : false
166166 matrix :
@@ -169,24 +169,24 @@ jobs:
169169 - ubuntu : 20.04
170170 containerd : v1.6.36
171171 rootlesskit : v1.1.1 # Deprecated
172- target : test-integration- rootless
172+ target : rootless
173173 - ubuntu : 22.04
174174 containerd : v1.7.23
175175 rootlesskit : v2.3.1
176- target : test-integration- rootless
176+ target : rootless
177177 - ubuntu : 24.04
178178 containerd : v2.0.0-rc.5
179179 rootlesskit : v2.3.1
180- target : test-integration- rootless
180+ target : rootless
181181 - ubuntu : 24.04
182182 containerd : v1.7.23
183183 rootlesskit : v2.3.1
184- target : test-integration- rootless-port-slirp4netns
184+ target : rootless-port-slirp4netns
185185 env :
186186 UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
187187 CONTAINERD_VERSION : " ${{ matrix.containerd }}"
188188 ROOTLESSKIT_VERSION : " ${{ matrix.rootlesskit }}"
189- TEST_TARGET : " ${{ matrix.target }}"
189+ TEST_TARGET : " test-integration- ${{ matrix.target }}"
190190 steps :
191191 - name : " Set up AppArmor"
192192 if : matrix.ubuntu == '24.04'
@@ -226,16 +226,14 @@ jobs:
226226 fi
227227 echo "WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622}" >> "$GITHUB_ENV"
228228 - name : " Test (network driver=slirp4netns, port driver=builtin)"
229- uses : nick-fields/retry@v3
230- with :
231- timeout_minutes : 30
232- max_attempts : 2
233- retry_on : error
234- command : docker run -t --rm --privileged -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622} ${TEST_TARGET}
229+ run : docker run -t --rm --privileged -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622} ${TEST_TARGET} /test-integration-rootless.sh ./hack/test-integration.sh -test.only-flaky=false
230+ - name : " Test (network driver=slirp4netns, port driver=builtin) (flaky)"
231+ run : docker run -t --rm --privileged -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622} ${TEST_TARGET} /test-integration-rootless.sh ./hack/test-integration.sh -test.only-flaky=true
235232
236- cross :
233+ build :
234+ timeout-minutes : 5
235+ name : " build | ${{ matrix.go-version }}"
237236 runs-on : ubuntu-24.04
238- timeout-minutes : 40
239237 strategy :
240238 matrix :
241239 go-version : ["1.22.x", "1.23.x"]
@@ -248,12 +246,13 @@ jobs:
248246 go-version : ${{ matrix.go-version }}
249247 cache : true
250248 check-latest : true
251- - name : " Cross "
249+ - name : " build "
252250 run : GO_VERSION="$(echo ${{ matrix.go-version }} | sed -e s/.x//)" make binaries
253251
254252 test-integration-docker-compatibility :
253+ timeout-minutes : 60
254+ name : docker
255255 runs-on : ubuntu-24.04
256- timeout-minutes : 45
257256 steps :
258257259258 with :
@@ -280,26 +279,18 @@ jobs:
280279 - name : " Prepare integration test environment"
281280 run : |
282281 sudo apt-get install -y expect
282+ go install -v gotest.tools/gotestsum@v1
283283 - name : " Ensure that the integration test suite is compatible with Docker"
284- uses : nick-fields/retry@v3
285- with :
286- timeout_minutes : 30
287- max_attempts : 2
288- retry_on : error
289- # See https://github.com/containerd/nerdctl/blob/main/docs/testing/README.md#about-parallelization
290- command : go test -p 1 -timeout 20m -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.allow-kill-daemon
284+ run : WITH_SUDO=true ./hack/test-integration.sh -test.target=docker
291285 - name : " Ensure that the IPv6 integration test suite is compatible with Docker"
292- uses : nick-fields/retry@v3
293- with :
294- timeout_minutes : 30
295- max_attempts : 2
296- retry_on : error
297- # See https://github.com/containerd/nerdctl/blob/main/docs/testing/README.md#about-parallelization
298- command : go test -p 1 -timeout 20m -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.allow-kill-daemon -test.only-ipv6
286+ run : WITH_SUDO=true ./hack/test-integration.sh -test.target=docker -test.only-ipv6
287+ - name : " Ensure that the integration test suite is compatible with Docker (flaky only)"
288+ run : WITH_SUDO=true ./hack/test-integration.sh -test.target=docker -test.only-flaky
299289
300290 test-integration-windows :
301- runs-on : windows-2022
302291 timeout-minutes : 30
292+ name : windows
293+ runs-on : windows-2022
303294 defaults :
304295 run :
305296 shell : bash
@@ -313,6 +304,7 @@ jobs:
313304 cache : true
314305 check-latest : true
315306 - run : go install ./cmd/nerdctl
307+ - run : go install -v gotest.tools/gotestsum@v1
316308317309 with :
318310 repository : containerd/containerd
@@ -326,16 +318,16 @@ jobs:
326318 env :
327319 ctrdVersion : 1.7.23
328320 run : powershell hack/configure-windows-ci.ps1
329- # TODO: Run unit tests
330321 - name : " Run integration tests"
331- # See https://github.com/containerd/nerdctl/blob/main/docs/testing/README.md#about-parallelization
332- run : go test -p 1 -v ./cmd/nerdctl/...
322+ run : ./hack/test-integration.sh -test.only-flaky=false
323+ - name : " Run integration tests (flaky)"
324+ run : ./hack/test-integration.sh -test.only-flaky=true
333325
334326 test-integration-freebsd :
327+ timeout-minutes : 60
335328 name : FreeBSD
336329 # ubuntu-24.04 lacks the vagrant package
337330 runs-on : ubuntu-22.04
338- timeout-minutes : 20
339331
340332 steps :
341333
0 commit comments