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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Patrick Steinhardt 2025-01-10 12:32:01 +01:00 committed by Junio C Hamano
parent 9548e0478e
commit b133d3071a
3 changed files with 8 additions and 20 deletions

View File

@ -275,7 +275,7 @@ jobs:
CC: ${{matrix.vector.cc}} CC: ${{matrix.vector.cc}}
CC_PACKAGE: ${{matrix.vector.cc_package}} CC_PACKAGE: ${{matrix.vector.cc_package}}
jobname: ${{matrix.vector.jobname}} jobname: ${{matrix.vector.jobname}}
distro: ${{matrix.vector.pool}} CI_JOB_IMAGE: ${{matrix.vector.pool}}
TEST_OUTPUT_DIRECTORY: ${{github.workspace}}/t TEST_OUTPUT_DIRECTORY: ${{github.workspace}}/t
runs-on: ${{matrix.vector.pool}} runs-on: ${{matrix.vector.pool}}
steps: steps:
@ -316,63 +316,49 @@ jobs:
- jobname: linux-sha256 - jobname: linux-sha256
image: ubuntu:latest image: ubuntu:latest
cc: clang cc: clang
distro: ubuntu-latest
- jobname: linux-reftable - jobname: linux-reftable
image: ubuntu:latest image: ubuntu:latest
cc: clang cc: clang
distro: ubuntu-latest
- jobname: linux-gcc - jobname: linux-gcc
image: ubuntu:20.04 image: ubuntu:20.04
cc: gcc cc: gcc
cc_package: gcc-8 cc_package: gcc-8
distro: ubuntu-20.04
- jobname: linux-TEST-vars - jobname: linux-TEST-vars
image: ubuntu:20.04 image: ubuntu:20.04
cc: gcc cc: gcc
cc_package: gcc-8 cc_package: gcc-8
distro: ubuntu-20.04
- jobname: linux-gcc-default - jobname: linux-gcc-default
image: ubuntu:latest image: ubuntu:latest
cc: gcc cc: gcc
distro: ubuntu-latest
- jobname: linux-leaks - jobname: linux-leaks
image: ubuntu:latest image: ubuntu:latest
cc: gcc cc: gcc
distro: ubuntu-latest
- jobname: linux-reftable-leaks - jobname: linux-reftable-leaks
image: ubuntu:latest image: ubuntu:latest
cc: gcc cc: gcc
distro: ubuntu-latest
- jobname: linux-asan-ubsan - jobname: linux-asan-ubsan
image: ubuntu:latest image: ubuntu:latest
cc: clang cc: clang
distro: ubuntu-latest
- jobname: linux-meson - jobname: linux-meson
image: ubuntu:latest image: ubuntu:latest
cc: gcc cc: gcc
distro: ubuntu-latest
- jobname: linux-musl - jobname: linux-musl
image: alpine image: alpine:latest
distro: alpine-latest
# Supported until 2025-04-02. # Supported until 2025-04-02.
- jobname: linux32 - jobname: linux32
image: i386/ubuntu:focal image: i386/ubuntu:focal
distro: ubuntu32-20.04
- jobname: pedantic - jobname: pedantic
image: fedora image: fedora:latest
distro: fedora-latest
# A RHEL 8 compatible distro. Supported until 2029-05-31. # A RHEL 8 compatible distro. Supported until 2029-05-31.
- jobname: almalinux-8 - jobname: almalinux-8
image: almalinux:8 image: almalinux:8
distro: almalinux-8
# Supported until 2026-08-31. # Supported until 2026-08-31.
- jobname: debian-11 - jobname: debian-11
image: debian:11 image: debian:11
distro: debian-11
env: env:
jobname: ${{matrix.vector.jobname}} jobname: ${{matrix.vector.jobname}}
distro: ${{matrix.vector.distro}}
CC: ${{matrix.vector.cc}} CC: ${{matrix.vector.cc}}
CI_JOB_IMAGE: ${{matrix.vector.image}}
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: ${{matrix.vector.image}} container: ${{matrix.vector.image}}
steps: steps:

View File

@ -33,7 +33,7 @@ fedora-*|almalinux-*)
dnf -yq update >/dev/null && dnf -yq update >/dev/null &&
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 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
;; ;;
ubuntu-*|ubuntu32-*|debian-*) ubuntu-*|i386/ubuntu-*|debian-*)
# Required so that apt doesn't wait for user input on certain packages. # Required so that apt doesn't wait for user input on certain packages.
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive


@ -42,7 +42,7 @@ ubuntu-*|ubuntu32-*|debian-*)
SVN='libsvn-perl subversion' SVN='libsvn-perl subversion'
LANGUAGES='language-pack-is' LANGUAGES='language-pack-is'
;; ;;
ubuntu32-*) i386/ubuntu-*)
SVN= SVN=
LANGUAGES='language-pack-is' LANGUAGES='language-pack-is'
;; ;;

View File

@ -246,6 +246,8 @@ then


GIT_TEST_OPTS="--github-workflow-markup" GIT_TEST_OPTS="--github-workflow-markup"
JOBS=10 JOBS=10

distro=$(echo "$CI_JOB_IMAGE" | tr : -)
elif test true = "$GITLAB_CI" elif test true = "$GITLAB_CI"
then then
CI_TYPE=gitlab-ci CI_TYPE=gitlab-ci