Skip to content

Commit b133d30

Browse files
pks-tgitster
authored andcommitted
github: simplify computation of the job's distro
We explicitly list the distro of Linux-based jobs, but it is equivalent to the name of the image in almost all cases, except that colons are replaced with dashes. Drop the redundant information and massage it in our CI scripts, which is equivalent to how we do it in GitLab CI. There are a couple of exceptions: - The "linux32" job, whose distro name is different than the image name. This is handled by adapting all sites to use the new name. - The "alpine" and "fedora" jobs, neither of which specify a tag for their image. This is handled by adding the "latest" tag. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9548e04 commit b133d30

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ jobs:
275275
CC: ${{matrix.vector.cc}}
276276
CC_PACKAGE: ${{matrix.vector.cc_package}}
277277
jobname: ${{matrix.vector.jobname}}
278-
distro: ${{matrix.vector.pool}}
278+
CI_JOB_IMAGE: ${{matrix.vector.pool}}
279279
TEST_OUTPUT_DIRECTORY: ${{github.workspace}}/t
280280
runs-on: ${{matrix.vector.pool}}
281281
steps:
@@ -316,63 +316,49 @@ jobs:
316316
- jobname: linux-sha256
317317
image: ubuntu:latest
318318
cc: clang
319-
distro: ubuntu-latest
320319
- jobname: linux-reftable
321320
image: ubuntu:latest
322321
cc: clang
323-
distro: ubuntu-latest
324322
- jobname: linux-gcc
325323
image: ubuntu:20.04
326324
cc: gcc
327325
cc_package: gcc-8
328-
distro: ubuntu-20.04
329326
- jobname: linux-TEST-vars
330327
image: ubuntu:20.04
331328
cc: gcc
332329
cc_package: gcc-8
333-
distro: ubuntu-20.04
334330
- jobname: linux-gcc-default
335331
image: ubuntu:latest
336332
cc: gcc
337-
distro: ubuntu-latest
338333
- jobname: linux-leaks
339334
image: ubuntu:latest
340335
cc: gcc
341-
distro: ubuntu-latest
342336
- jobname: linux-reftable-leaks
343337
image: ubuntu:latest
344338
cc: gcc
345-
distro: ubuntu-latest
346339
- jobname: linux-asan-ubsan
347340
image: ubuntu:latest
348341
cc: clang
349-
distro: ubuntu-latest
350342
- jobname: linux-meson
351343
image: ubuntu:latest
352344
cc: gcc
353-
distro: ubuntu-latest
354345
- jobname: linux-musl
355-
image: alpine
356-
distro: alpine-latest
346+
image: alpine:latest
357347
# Supported until 2025-04-02.
358348
- jobname: linux32
359349
image: i386/ubuntu:focal
360-
distro: ubuntu32-20.04
361350
- jobname: pedantic
362-
image: fedora
363-
distro: fedora-latest
351+
image: fedora:latest
364352
# A RHEL 8 compatible distro. Supported until 2029-05-31.
365353
- jobname: almalinux-8
366354
image: almalinux:8
367-
distro: almalinux-8
368355
# Supported until 2026-08-31.
369356
- jobname: debian-11
370357
image: debian:11
371-
distro: debian-11
372358
env:
373359
jobname: ${{matrix.vector.jobname}}
374-
distro: ${{matrix.vector.distro}}
375360
CC: ${{matrix.vector.cc}}
361+
CI_JOB_IMAGE: ${{matrix.vector.image}}
376362
runs-on: ubuntu-latest
377363
container: ${{matrix.vector.image}}
378364
steps:

ci/install-dependencies.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fedora-*|almalinux-*)
3333
dnf -yq update >/dev/null &&
3434
dnf -yq install shadow-utils sudo make gcc findutils diffutils perl python3 gettext zlib-devel expat-devel openssl-devel curl-devel pcre2-devel >/dev/null
3535
;;
36-
ubuntu-*|ubuntu32-*|debian-*)
36+
ubuntu-*|i386/ubuntu-*|debian-*)
3737
# Required so that apt doesn't wait for user input on certain packages.
3838
export DEBIAN_FRONTEND=noninteractive
3939

@@ -42,7 +42,7 @@ ubuntu-*|ubuntu32-*|debian-*)
4242
SVN='libsvn-perl subversion'
4343
LANGUAGES='language-pack-is'
4444
;;
45-
ubuntu32-*)
45+
i386/ubuntu-*)
4646
SVN=
4747
LANGUAGES='language-pack-is'
4848
;;

ci/lib.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ then
246246

247247
GIT_TEST_OPTS="--github-workflow-markup"
248248
JOBS=10
249+
250+
distro=$(echo "$CI_JOB_IMAGE" | tr : -)
249251
elif test true = "$GITLAB_CI"
250252
then
251253
CI_TYPE=gitlab-ci

0 commit comments

Comments
 (0)