github-actions: run gcc-8 on ubuntu-20.04 image

GitHub starts to upgrade its runner image "ubuntu-latest" from version "ubuntu-20.04" to version "ubuntu-22.04". It will fail to find and install "gcc-8" package on the new runner image. Change some of the runner images from "ubuntu-latest" to "ubuntu-20.04" in order to install "gcc-8" as a dependency. The first revision of this patch tried to replace "$runs_on_pool" in "ci/*.sh" with a new "$runs_on_os" environment variable based on the "os" field in the matrix strategy. But these "os" fields in matrix strategies are obsolete legacies from commit [1] and commit [2], and are no longer useful. So remove these unused "os" fields. [1]: c08bb26010 (CI: rename the "Linux32" job to lower-case "linux32", 2021-11-23) [2]: 25715419bf (CI: don't run "make test" twice in one job, 2021-11-23) Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de> Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jiang Xin committed Nov 25, 2022 at 17:59 UTC 0178420b9ca67fd4c23df1bea49f45b2aa2a5330
3 files changed +4 -7
.github/workflows/main.yml
+2 -5
@@ -227,17 +227,15 @@ jobs:
227 pool: ubuntu-latest
228 - jobname: linux-sha256
229 cc: clang
230 - os: ubuntu
230 pool: ubuntu-latest
231 - jobname: linux-gcc
232 cc: gcc
233 cc_package: gcc-8
235 - pool: ubuntu-latest
234 + pool: ubuntu-20.04
235 - jobname: linux-TEST-vars
236 cc: gcc
238 - os: ubuntu
237 cc_package: gcc-8
240 - pool: ubuntu-latest
238 + pool: ubuntu-20.04
239 - jobname: osx-clang
240 cc: clang
241 pool: macos-latest
@@ -282,7 +280,6 @@ jobs:
280 - jobname: linux-musl
281 image: alpine
282 - jobname: linux32
285 - os: ubuntu32
283 image: daald/ubuntu32:xenial
284 - jobname: pedantic
285 image: fedora
ci/install-dependencies.sh
+1 -1
@@ -12,7 +12,7 @@ UBUNTU_COMMON_PKGS="make libssl-dev libcurl4-openssl-dev libexpat-dev
12 libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl"
13
14 case "$runs_on_pool" in
15 -ubuntu-latest)
15 +ubuntu-*)
16 sudo apt-get -q update
17 sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
18 $UBUNTU_COMMON_PKGS $CC_PACKAGE
ci/lib.sh
+1 -1
@@ -226,7 +226,7 @@ export GIT_TEST_CLONE_2GB=true
226 export SKIP_DASHED_BUILT_INS=YesPlease
227
228 case "$runs_on_pool" in
229 -ubuntu-latest)
229 +ubuntu-*)
230 if test "$jobname" = "linux-gcc-default"
231 then
232 break