github: convert all Linux jobs to be containerized

We have split the CI jobs in GitHub Workflows into two categories: - Those running on a machine pool directly. - Those running in a container on the machine pool. The latter is more flexible because it allows us to freely pick whatever container image we want to use for a specific job, while the former only allows us to pick from a handful of different distros. The containerized jobs do not have any significant downsides to the best of my knowledge: - They aren't significantly slower to start up. A quick comparison by Peff shows that the difference is mostly lost in the noise: job | old | new --------------------|------|------ linux-TEST-vars 11m30s 10m54s linux-asan-ubsan 30m26s 31m14s linux-gcc 9m47s 10m6s linux-gcc-default 9m47s 9m41s linux-leaks 25m50s 25m21s linux-meson 10m36s 10m41s linux-reftable 10m25s 10m23s linux-reftable-leaks 27m18s 27m28s linux-sha256 9m54s 10m31s Some jobs are a bit faster, some are a bit slower, but there does not seem to be any significant change. - Containerized jobs run as root, which keeps a couple of tests from running. This has been addressed in the preceding commit though, where we now use setpriv(1) to run tests as a separate user. - GitHub injects a Node binary into containerized jobs, which is dynamically linked. This has led to some issues in the past [1], but only for our 32 bit jobs. The issues have since been resolved. Overall there seem to be no downsides, but the upside is that we have more control over the exact image that these jobs use. Convert the Linux jobs accordingly. [1]: https://lore.kernel.org/git/20240912094841.GD589828@coredump.intra.peff.net/ Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Jan 10, 2025 at 12:32 UTC 9548e0478edaad0ec1e5dc4b7afc7af51dee43b0
1 file changed +39 -29
.github/workflows/main.yml
+39 -29
@@ -259,20 +259,6 @@ jobs:
259 fail-fast: false
260 matrix:
261 vector:
262 - - jobname: linux-sha256
263 - cc: clang
264 - pool: ubuntu-latest
265 - - jobname: linux-reftable
266 - cc: clang
267 - pool: ubuntu-latest
268 - - jobname: linux-gcc
269 - cc: gcc
270 - cc_package: gcc-8
271 - pool: ubuntu-20.04
272 - - jobname: linux-TEST-vars
273 - cc: gcc
274 - cc_package: gcc-8
275 - pool: ubuntu-20.04
262 - jobname: osx-clang
263 cc: clang
264 pool: macos-13
@@ -285,21 +271,6 @@ jobs:
271 - jobname: osx-meson
272 cc: clang
273 pool: macos-13
288 - - jobname: linux-gcc-default
289 - cc: gcc
290 - pool: ubuntu-latest
291 - - jobname: linux-leaks
292 - cc: gcc
293 - pool: ubuntu-latest
294 - - jobname: linux-reftable-leaks
295 - cc: gcc
296 - pool: ubuntu-latest
297 - - jobname: linux-asan-ubsan
298 - cc: clang
299 - pool: ubuntu-latest
300 - - jobname: linux-meson
301 - cc: gcc
302 - pool: ubuntu-latest
274 env:
275 CC: ${{matrix.vector.cc}}
276 CC_PACKAGE: ${{matrix.vector.cc_package}}
@@ -342,6 +313,44 @@ jobs:
313 fail-fast: false
314 matrix:
315 vector:
316 + - jobname: linux-sha256
317 + image: ubuntu:latest
318 + cc: clang
319 + distro: ubuntu-latest
320 + - jobname: linux-reftable
321 + image: ubuntu:latest
322 + cc: clang
323 + distro: ubuntu-latest
324 + - jobname: linux-gcc
325 + image: ubuntu:20.04
326 + cc: gcc
327 + cc_package: gcc-8
328 + distro: ubuntu-20.04
329 + - jobname: linux-TEST-vars
330 + image: ubuntu:20.04
331 + cc: gcc
332 + cc_package: gcc-8
333 + distro: ubuntu-20.04
334 + - jobname: linux-gcc-default
335 + image: ubuntu:latest
336 + cc: gcc
337 + distro: ubuntu-latest
338 + - jobname: linux-leaks
339 + image: ubuntu:latest
340 + cc: gcc
341 + distro: ubuntu-latest
342 + - jobname: linux-reftable-leaks
343 + image: ubuntu:latest
344 + cc: gcc
345 + distro: ubuntu-latest
346 + - jobname: linux-asan-ubsan
347 + image: ubuntu:latest
348 + cc: clang
349 + distro: ubuntu-latest
350 + - jobname: linux-meson
351 + image: ubuntu:latest
352 + cc: gcc
353 + distro: ubuntu-latest
354 - jobname: linux-musl
355 image: alpine
356 distro: alpine-latest
@@ -363,6 +372,7 @@ jobs:
372 env:
373 jobname: ${{matrix.vector.jobname}}
374 distro: ${{matrix.vector.distro}}
375 + CC: ${{matrix.vector.cc}}
376 runs-on: ubuntu-latest
377 container: ${{matrix.vector.image}}
378 steps: