From 4a6e4b9602630d50eb9d630c721bb01df97049f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 23 Nov 2021 17:29:08 +0100 Subject: [PATCH 1/5] CI: remove Travis CI support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove support for running the CI in travis. The last builds in it are from 5 months ago[1] (as of 2021-11-19), and our documentation has referred to GitHub CI instead since f003a91f5c5 (SubmittingPatches: replace discussion of Travis with GitHub Actions, 2021-07-22). We'll now run the "t9810 t9816" and tests on OSX. We didn't before, as we'd carried the Travis exclusion of them forward from 522354d70f4 (Add Travis CI support, 2015-11-27). Let's hope whatever issue there was with them was either Travis specific, or fixed since then (I'm not sure). The "apt-add-repository" invocation (which we were doing in GitHub CI) isn't needed, it was another Travis-only case that was carried forward into more general code. See 0f0c51181df (travis-ci: install packages in 'ci/install-dependencies.sh', 2018-11-01). Remove the "linux-gcc-4.8" job added in fb9d7431cf4 (travis-ci: build with GCC 4.8 as well, 2019-07-18), it only ran in Travis CI. 1. https://travis-ci.org/github/git/git/builds Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- .travis.yml | 60 -------------------------------------- ci/install-dependencies.sh | 3 +- ci/lib.sh | 37 ++--------------------- ci/print-test-failures.sh | 10 ------- ci/run-build-and-tests.sh | 4 +-- ci/run-docker-build.sh | 9 ------ ci/run-docker.sh | 2 +- 7 files changed, 7 insertions(+), 118 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 908330a0a3..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,60 +0,0 @@ -language: c - -cache: - directories: - - $HOME/travis-cache - -os: - - linux - - osx - -osx_image: xcode10.1 - -compiler: - - clang - - gcc - -matrix: - include: - - env: jobname=linux-gcc-default - os: linux - compiler: - addons: - before_install: - - env: jobname=linux-gcc-4.8 - os: linux - dist: trusty - compiler: - - env: jobname=Linux32 - os: linux - compiler: - addons: - services: - - docker - before_install: - script: ci/run-docker.sh - - env: jobname=linux-musl - os: linux - compiler: - addons: - services: - - docker - before_install: - script: ci/run-docker.sh - - env: jobname=StaticAnalysis - os: linux - compiler: - script: ci/run-static-analysis.sh - after_failure: - - env: jobname=Documentation - os: linux - compiler: - script: ci/test-documentation.sh - after_failure: - -before_install: ci/install-dependencies.sh -script: ci/run-build-and-tests.sh -after_failure: ci/print-test-failures.sh - -notifications: - email: false diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh index 1d0e48f451..49a4ae7a98 100755 --- a/ci/install-dependencies.sh +++ b/ci/install-dependencies.sh @@ -13,7 +13,6 @@ UBUNTU_COMMON_PKGS="make libssl-dev libcurl4-openssl-dev libexpat-dev case "$jobname" in linux-clang|linux-gcc|linux-leaks) - sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" sudo apt-get -q update sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \ $UBUNTU_COMMON_PKGS @@ -77,7 +76,7 @@ Documentation) test -n "$ALREADY_HAVE_ASCIIDOCTOR" || sudo gem install --version 1.5.8 asciidoctor ;; -linux-gcc-default|linux-gcc-4.8) +linux-gcc-default) sudo apt-get -q update sudo apt-get -q -y install $UBUNTU_COMMON_PKGS ;; diff --git a/ci/lib.sh b/ci/lib.sh index 82cb17f8ee..73d959e87f 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -34,7 +34,7 @@ save_good_tree () { # successfully before (e.g. because the branch got rebased, changing only # the commit messages). skip_good_tree () { - if test "$TRAVIS_DEBUG_MODE" = true || test true = "$GITHUB_ACTIONS" + if test true = "$GITHUB_ACTIONS" then return fi @@ -60,7 +60,7 @@ skip_good_tree () { cat <<-EOF $(tput setaf 2)Skipping build job for commit $CI_COMMIT.$(tput sgr0) This commit's tree has already been built and tested successfully in build job $prev_good_job_number for commit $prev_good_commit. - The log of that build job is available at $(url_for_job_id $prev_good_job_id) + The log of that build job is available at $SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$prev_good_job_id To force a re-build delete the branch's cache and then hit 'Restart job'. EOF fi @@ -91,29 +91,7 @@ export MAKEFLAGS= # and installing dependencies. set -ex -if test true = "$TRAVIS" -then - CI_TYPE=travis - # When building a PR, TRAVIS_BRANCH refers to the *target* branch. Not - # what we want here. We want the source branch instead. - CI_BRANCH="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" - CI_COMMIT="$TRAVIS_COMMIT" - CI_JOB_ID="$TRAVIS_JOB_ID" - CI_JOB_NUMBER="$TRAVIS_JOB_NUMBER" - CI_OS_NAME="$TRAVIS_OS_NAME" - CI_REPO_SLUG="$TRAVIS_REPO_SLUG" - - cache_dir="$HOME/travis-cache" - - url_for_job_id () { - echo "https://travis-ci.org/$CI_REPO_SLUG/jobs/$1" - } - - BREW_INSTALL_PACKAGES="git-lfs gettext" - export GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save" - export GIT_TEST_OPTS="--verbose-log -x --immediate" - MAKEFLAGS="$MAKEFLAGS --jobs=2" -elif test -n "$SYSTEM_COLLECTIONURI" || test -n "$SYSTEM_TASKDEFINITIONSURI" +if test -n "$SYSTEM_COLLECTIONURI" || test -n "$SYSTEM_TASKDEFINITIONSURI" then CI_TYPE=azure-pipelines # We are running in Azure Pipelines @@ -130,10 +108,6 @@ then # among *all* phases) cache_dir="$HOME/test-cache/$SYSTEM_PHASENAME" - url_for_job_id () { - echo "$SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$1" - } - export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save" export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml" MAKEFLAGS="$MAKEFLAGS --jobs=10" @@ -214,11 +188,6 @@ osx-clang|osx-gcc) else MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python2)" fi - - # t9810 occasionally fails on Travis CI OS X - # t9816 occasionally fails with "TAP out of sequence errors" on - # Travis CI OS X - export GIT_SKIP_TESTS="t9810 t9816" ;; linux-gcc-default) ;; diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh index c70d6cdbf2..57277eefcd 100755 --- a/ci/print-test-failures.sh +++ b/ci/print-test-failures.sh @@ -39,8 +39,6 @@ do test_name="${test_name##*/}" trash_dir="trash directory.$test_name" case "$CI_TYPE" in - travis) - ;; azure-pipelines) mkdir -p failed-test-artifacts mv "$trash_dir" failed-test-artifacts @@ -88,11 +86,3 @@ do fi fi done - -if [ $combined_trash_size -gt 0 ] -then - echo "------------------------------------------------------------------------" - echo "Trash directories embedded in this log can be extracted by running:" - echo - echo " curl https://api.travis-ci.org/v3/job/$TRAVIS_JOB_ID/log.txt |./ci/util/extract-trash-dirs.sh" -fi diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index cc62616d80..18056501ec 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -41,9 +41,9 @@ linux-clang) export GIT_TEST_DEFAULT_HASH=sha256 make test ;; -linux-gcc-4.8|pedantic) +pedantic) # Don't run the tests; we only care about whether Git can be - # built with GCC 4.8 or with pedantic + # built. ;; *) make test diff --git a/ci/run-docker-build.sh b/ci/run-docker-build.sh index 8d47a5fda3..5d2764ad3a 100755 --- a/ci/run-docker-build.sh +++ b/ci/run-docker-build.sh @@ -47,15 +47,6 @@ else else useradd -u $HOST_UID $CI_USER fi - - # Due to a bug the test suite was run as root in the past, so - # a prove state file created back then is only accessible by - # root. Now that bug is fixed, the test suite is run as a - # regular user, but the prove state file coming from Travis - # CI's cache might still be owned by root. - # Make sure that this user has rights to any cached files, - # including an existing prove state file. - test -n "$cache_dir" && chown -R $HOST_UID:$HOST_UID "$cache_dir" fi # Build and test diff --git a/ci/run-docker.sh b/ci/run-docker.sh index 37fa372052..b610dd4db8 100755 --- a/ci/run-docker.sh +++ b/ci/run-docker.sh @@ -25,7 +25,7 @@ docker pull "$CI_CONTAINER" # root@container:/# export jobname= # root@container:/# /usr/src/git/ci/run-docker-build.sh -container_cache_dir=/tmp/travis-cache +container_cache_dir=/tmp/container-cache docker run \ --interactive \ From df7375d77287f3665867b99ae18fc3cbe3289a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 23 Nov 2021 17:29:09 +0100 Subject: [PATCH 2/5] CI: use shorter names that fit in UX tooltips MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the names used for the GitHub CI workflows to be short enough to (mostly) fit in the pop-up tool-tips that GitHub shows in the commit view. I.e. when mouse-clicking on the passing or failing check-mark next to the commit subject. These names are seemingly truncated to 17-20 characters followed by three dots ("..."). Since a "CI/PR / " prefix is added to them the job names looked like this before (windows-test and vs-test jobs omitted): CI/PR / ci-config (p... CI/PR / windows-buil... CI/PR / vs-build (pu... CI/PR / regular (lin... CI/PR / regular (lin... CI/PR / regular (os... CI/PR / regular (os... CI/PR / regular (lin... CI/PR / regular (lin... CI/PR / dockerized (... CI/PR / dockerized (... CI/PR / dockerized (... CI/PR / static-anal... CI/PR / sparse (pu... CI/PR / documenta... By omitting the "/PR" from the top-level name, and pushing the $jobname to the front we'll now instead get: CI / config (push) CI / win build (push... CI / win+VS build (... CI / linux-clang (ub... CI / linux-gcc (ubun... CI / osx-clang (osx)... CI / osx-gcc (osx) (... CI / linux-gcc-defau... CI / linux-leaks (ub... CI / linux-musl (alp... CI / Linux32 (daald/... CI / pedantic (fedor... CI / static-analysis... CI / sparse (push)... CI / documentation We then have no truncation in the expanded view. See [1] for how it looked before, [2] for a currently visible CI run using this commit, and [3] for the GitHub workflow syntax involved being changed here. Let's also use the existing "pool" field as before. It's occasionally useful to know we're running on say ubuntu v.s. fedora. The "-latest" suffix is useful to some[4], and since it's now at the end it doesn't hurt readability in the short view compared to saying "ubuntu" or "macos". 1. https://github.com/git/git/tree/master/ 2. https://github.com/avar/git/tree/avar/ci-rm-travis-cleanup-ci-names-3 3. https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions 3. https://lore.kernel.org/git/d9b07ca5-b58d-a535-d25b-85d7f12e6295@github.com/ Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- .github/workflows/main.yml | 10 +++++++++- README.md | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6ed6a9e807..c7c1045657 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: CI/PR +name: CI on: [push, pull_request] @@ -7,6 +7,7 @@ env: jobs: ci-config: + name: config runs-on: ubuntu-latest outputs: enabled: ${{ steps.check-ref.outputs.enabled }}${{ steps.skip-if-redundant.outputs.enabled }} @@ -77,6 +78,7 @@ jobs: } windows-build: + name: win build needs: ci-config if: needs.ci-config.outputs.enabled == 'yes' runs-on: windows-latest @@ -97,6 +99,7 @@ jobs: name: windows-artifacts path: artifacts windows-test: + name: win test runs-on: windows-latest needs: [windows-build] strategy: @@ -127,6 +130,7 @@ jobs: name: failed-tests-windows path: ${{env.FAILED_TEST_ARTIFACTS}} vs-build: + name: win+VS build needs: ci-config if: needs.ci-config.outputs.enabled == 'yes' env: @@ -178,6 +182,7 @@ jobs: name: vs-artifacts path: artifacts vs-test: + name: win+VS test runs-on: windows-latest needs: vs-build strategy: @@ -210,6 +215,7 @@ jobs: name: failed-tests-windows path: ${{env.FAILED_TEST_ARTIFACTS}} regular: + name: ${{matrix.vector.jobname}} (${{matrix.vector.pool}}) needs: ci-config if: needs.ci-config.outputs.enabled == 'yes' strategy: @@ -251,6 +257,7 @@ jobs: name: failed-tests-${{matrix.vector.jobname}} path: ${{env.FAILED_TEST_ARTIFACTS}} dockerized: + name: ${{matrix.vector.jobname}} (${{matrix.vector.image}}) needs: ci-config if: needs.ci-config.outputs.enabled == 'yes' strategy: @@ -310,6 +317,7 @@ jobs: run: ci/install-dependencies.sh - run: make sparse documentation: + name: documentation needs: ci-config if: needs.ci-config.outputs.enabled == 'yes' env: diff --git a/README.md b/README.md index eb8115e6b0..f6f43e78de 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build status](https://github.com/git/git/workflows/CI/PR/badge.svg)](https://github.com/git/git/actions?query=branch%3Amaster+event%3Apush) +[![Build status](https://github.com/git/git/workflows/CI/badge.svg)](https://github.com/git/git/actions?query=branch%3Amaster+event%3Apush) Git - fast, scalable, distributed revision control system ========================================================= From c08bb260105fc7307be65f30e65c0f7305f0e3ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 23 Nov 2021 17:29:10 +0100 Subject: [PATCH 3/5] CI: rename the "Linux32" job to lower-case "linux32" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As a follow-up to the preceding commit's shortening of CI job names, rename the only job that starts with an upper-case letter to be consistent with the rest. It was added in 88dedd5e72c (Travis: also test on 32-bit Linux, 2017-03-05). Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- .github/workflows/main.yml | 3 ++- ci/install-docker-dependencies.sh | 2 +- ci/lib.sh | 2 +- ci/run-docker-build.sh | 2 +- ci/run-docker.sh | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c7c1045657..91b565f75b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -266,7 +266,8 @@ jobs: vector: - jobname: linux-musl image: alpine - - jobname: Linux32 + - jobname: linux32 + os: ubuntu32 image: daald/ubuntu32:xenial - jobname: pedantic image: fedora diff --git a/ci/install-docker-dependencies.sh b/ci/install-docker-dependencies.sh index 07a8c6b199..78b7e326da 100755 --- a/ci/install-docker-dependencies.sh +++ b/ci/install-docker-dependencies.sh @@ -4,7 +4,7 @@ # case "$jobname" in -Linux32) +linux32) linux32 --32bit i386 sh -c ' apt update >/dev/null && apt install -y build-essential libcurl4-openssl-dev \ diff --git a/ci/lib.sh b/ci/lib.sh index 73d959e87f..0b3b014488 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -191,7 +191,7 @@ osx-clang|osx-gcc) ;; linux-gcc-default) ;; -Linux32) +linux32) CC=gcc ;; linux-musl) diff --git a/ci/run-docker-build.sh b/ci/run-docker-build.sh index 5d2764ad3a..6cd832efb9 100755 --- a/ci/run-docker-build.sh +++ b/ci/run-docker-build.sh @@ -15,7 +15,7 @@ then fi case "$jobname" in -Linux32) +linux32) switch_cmd="linux32 --32bit i386" ;; linux-musl) diff --git a/ci/run-docker.sh b/ci/run-docker.sh index b610dd4db8..af89d1624a 100755 --- a/ci/run-docker.sh +++ b/ci/run-docker.sh @@ -6,7 +6,7 @@ . ${0%/*}/lib.sh case "$jobname" in -Linux32) +linux32) CI_CONTAINER="daald/ubuntu32:xenial" ;; linux-musl) From 707d2f2fe8601c1f425be1233a72bac872c0b4b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 23 Nov 2021 17:29:11 +0100 Subject: [PATCH 4/5] CI: use "$runs_on_pool", not "$jobname" to select packages & config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the setup hooks for the CI to use "$runs_on_pool" for the "$regular" job. Now we won't need as much boilerplate when adding new jobs to the "regular" matrix, see 956d2e4639b (tests: add a test mode for SANITIZE=leak, run it in CI, 2021-09-23) for the last such commit. I.e. now instead of needing to enumerate each jobname when we select packages we can install things depending on the pool we're running in. That we didn't do this dates back to the now gone dependency on Travis CI, but even if we add a new CI target in the future this'll be easier to port over, since we can probably treat "ubuntu-latest" as a stand-in for some recent Linux that can run "apt" commands. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- .github/workflows/main.yml | 4 ++++ ci/install-dependencies.sh | 32 ++++++++++++++------------------ ci/lib.sh | 21 +++++++++++---------- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91b565f75b..d402402a18 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -227,12 +227,14 @@ jobs: pool: ubuntu-latest - jobname: linux-gcc cc: gcc + cc_package: gcc-8 pool: ubuntu-latest - jobname: osx-clang cc: clang pool: macos-latest - jobname: osx-gcc cc: gcc + cc_package: gcc-9 pool: macos-latest - jobname: linux-gcc-default cc: gcc @@ -242,7 +244,9 @@ jobs: pool: ubuntu-latest env: CC: ${{matrix.vector.cc}} + CC_PACKAGE: ${{matrix.vector.cc_package}} jobname: ${{matrix.vector.jobname}} + runs_on_pool: ${{matrix.vector.pool}} runs-on: ${{matrix.vector.pool}} steps: - uses: actions/checkout@v2 diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh index 49a4ae7a98..dbcebad2fb 100755 --- a/ci/install-dependencies.sh +++ b/ci/install-dependencies.sh @@ -11,17 +11,11 @@ UBUNTU_COMMON_PKGS="make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl" -case "$jobname" in -linux-clang|linux-gcc|linux-leaks) +case "$runs_on_pool" in +ubuntu-latest) sudo apt-get -q update sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \ - $UBUNTU_COMMON_PKGS - case "$jobname" in - linux-gcc) - sudo apt-get -q -y install gcc-8 - ;; - esac - + $UBUNTU_COMMON_PKGS $CC_PACKAGE mkdir --parents "$P4_PATH" pushd "$P4_PATH" wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d" @@ -36,7 +30,7 @@ linux-clang|linux-gcc|linux-leaks) cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs . popd ;; -osx-clang|osx-gcc) +macos-latest) export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 # Uncomment this if you want to run perf tests: # brew install gnu-time @@ -50,15 +44,17 @@ osx-clang|osx-gcc) brew install --cask --no-quarantine perforce } || brew install homebrew/cask/perforce - case "$jobname" in - osx-gcc) - brew install gcc@9 - # Just in case the image is updated to contain gcc@9 - # pre-installed but not linked. - brew link gcc@9 - ;; - esac + + if test -n "$CC_PACKAGE" + then + BREW_PACKAGE=${CC_PACKAGE/-/@} + brew install "$BREW_PACKAGE" + brew link "$BREW_PACKAGE" + fi ;; +esac + +case "$jobname" in StaticAnalysis) sudo apt-get -q update sudo apt-get -q -y install coccinelle libcurl4-openssl-dev libssl-dev \ diff --git a/ci/lib.sh b/ci/lib.sh index 0b3b014488..cbc2f8f1ca 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -156,11 +156,15 @@ export DEFAULT_TEST_TARGET=prove export GIT_TEST_CLONE_2GB=true export SKIP_DASHED_BUILT_INS=YesPlease -case "$jobname" in -linux-clang|linux-gcc|linux-leaks) +case "$runs_on_pool" in +ubuntu-latest) + if test "$jobname" = "linux-gcc-default" + then + break + fi + if [ "$jobname" = linux-gcc ] then - export CC=gcc-8 MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python3" else MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python2" @@ -180,17 +184,17 @@ linux-clang|linux-gcc|linux-leaks) GIT_LFS_PATH="$HOME/custom/git-lfs" export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH" ;; -osx-clang|osx-gcc) +macos-latest) if [ "$jobname" = osx-gcc ] then - export CC=gcc-9 MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python3)" else MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python2)" fi ;; -linux-gcc-default) - ;; +esac + +case "$jobname" in linux32) CC=gcc ;; @@ -200,9 +204,6 @@ linux-musl) MAKEFLAGS="$MAKEFLAGS NO_REGEX=Yes ICONV_OMITS_BOM=Yes" MAKEFLAGS="$MAKEFLAGS GIT_TEST_UTF8_LOCALE=C.UTF-8" ;; -esac - -case "$jobname" in linux-leaks) export SANITIZE=leak export GIT_TEST_PASSING_SANITIZE_LEAK=true From 25715419bf4d105d755e0f6d2228e1ac0bd06b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 23 Nov 2021 17:29:12 +0100 Subject: [PATCH 5/5] CI: don't run "make test" twice in one job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "linux-clang" and "linux-gcc" jobs both run "make test" twice, but with different environment variables. Running these in sequence seems to have been done to work around some constraint on Travis, see ae59a4e44f3 (travis: run tests with GIT_TEST_SPLIT_INDEX, 2018-01-07). By having these run in parallel we'll get jobs that finish much sooner than they otherwise would have. We can also simplify the control flow in "ci/run-build-and-tests.sh" as a result, since we won't run "make test" twice we don't need to run "make" twice at all, let's default to "make all test" after setting the variables, and then override it to just "all" for the compile-only tests. Add a comment to clarify that new "test" targets should adjust $MAKE_TARGETS rather than being added after the "case/esac". This should avoid future confusion where e.g. the compilation-only "pedantic" target will unexpectedly start running tests. See [1] and [2]. 1. https://lore.kernel.org/git/211122.86ee78yxts.gmgdl@evledraar.gmail.com/ 2. https://lore.kernel.org/git/211123.86ilwjujmd.gmgdl@evledraar.gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- .github/workflows/main.yml | 9 +++++++++ ci/run-build-and-tests.sh | 23 +++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d402402a18..628bcbf495 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -225,10 +225,19 @@ jobs: - jobname: linux-clang cc: clang pool: ubuntu-latest + - jobname: linux-sha256 + cc: clang + os: ubuntu + pool: ubuntu-latest - jobname: linux-gcc cc: gcc cc_package: gcc-8 pool: ubuntu-latest + - jobname: linux-TEST-vars + cc: gcc + os: ubuntu + cc_package: gcc-8 + pool: ubuntu-latest - jobname: osx-clang cc: clang pool: macos-latest diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index 18056501ec..280dda7d28 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -10,16 +10,13 @@ windows*) cmd //c mklink //j t\\.prove "$(cygpath -aw "$cache_dir/.prove")";; *) ln -s "$cache_dir/.prove" t/.prove;; esac -if test "$jobname" = "pedantic" -then - export DEVOPTS=pedantic -fi +export MAKE_TARGETS="all test" -make case "$jobname" in linux-gcc) export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - make test + ;; +linux-TEST-vars) export GIT_TEST_SPLIT_INDEX=yes export GIT_TEST_MERGE_ALGORITHM=recursive export GIT_TEST_FULL_IN_PACK_ARRAY=true @@ -33,23 +30,25 @@ linux-gcc) export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_WRITE_REV_INDEX=1 export GIT_TEST_CHECKOUT_WORKERS=2 - make test ;; linux-clang) export GIT_TEST_DEFAULT_HASH=sha1 - make test + ;; +linux-sha256) export GIT_TEST_DEFAULT_HASH=sha256 - make test ;; pedantic) # Don't run the tests; we only care about whether Git can be # built. - ;; -*) - make test + export DEVOPTS=pedantic + export MAKE_TARGETS=all ;; esac +# Any new "test" targets should not go after this "make", but should +# adjust $MAKE_TARGETS. Otherwise compilation-only targets above will +# start running tests. +make $MAKE_TARGETS check_unignored_build_artifacts save_good_tree