diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-02-03 09:24:25 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-02-03 09:24:25 -0800 |
| commit | f9d4bb7b9ae14a740f6c074149e7948bf6dcc3fb (patch) | |
| tree | 2d2e4c565794d273f0735296bc069b96a04356e3 | |
| parent | f93ff170b93a1782659637824b25923245ac9dd1 (diff) | |
| parent | e39e332e5043d7e8f48fbfc91c3bd6d45a52cb7b (diff) | |
| download | git-f9d4bb7b9ae14a740f6c074149e7948bf6dcc3fb.tar.gz | |
Merge branch 'ps/ci-misc-updates' into jk/ci-coverity-update
* ps/ci-misc-updates:
ci: remove stale code for Azure Pipelines
ci: use latest Ubuntu release
ci: stop special-casing for Ubuntu 16.04
gitlab-ci: add linux32 job testing against i386
gitlab-ci: remove the "linux-old" job
github: simplify computation of the job's distro
github: convert all Linux jobs to be containerized
github: adapt containerized jobs to be rootless
t7422: fix flaky test caused by buffered stdout
t0060: fix EBUSY in MinGW when setting up runtime prefix
| -rw-r--r-- | .github/workflows/main.yml | 78 | ||||
| -rw-r--r-- | .gitlab-ci.yml | 19 | ||||
| -rwxr-xr-x | ci/install-dependencies.sh | 6 | ||||
| -rwxr-xr-x | ci/lib.sh | 34 | ||||
| -rwxr-xr-x | ci/print-test-failures.sh | 5 | ||||
| -rwxr-xr-x | t/t0060-path-utils.sh | 10 | ||||
| -rwxr-xr-x | t/t7422-submodule-output.sh | 43 |
7 files changed, 100 insertions, 95 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 900be9957a..b90381ae01 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -259,20 +259,6 @@ jobs: fail-fast: false matrix: vector: - - jobname: linux-sha256 - cc: clang - pool: ubuntu-latest - - jobname: linux-reftable - cc: clang - pool: ubuntu-latest - - jobname: linux-gcc - cc: gcc - cc_package: gcc-8 - pool: ubuntu-20.04 - - jobname: linux-TEST-vars - cc: gcc - cc_package: gcc-8 - pool: ubuntu-20.04 - jobname: osx-clang cc: clang pool: macos-13 @@ -285,26 +271,11 @@ jobs: - jobname: osx-meson cc: clang pool: macos-13 - - jobname: linux-gcc-default - cc: gcc - pool: ubuntu-latest - - jobname: linux-leaks - cc: gcc - pool: ubuntu-latest - - jobname: linux-reftable-leaks - cc: gcc - pool: ubuntu-latest - - jobname: linux-asan-ubsan - cc: clang - pool: ubuntu-latest - - jobname: linux-meson - cc: gcc - pool: ubuntu-latest env: CC: ${{matrix.vector.cc}} CC_PACKAGE: ${{matrix.vector.cc_package}} jobname: ${{matrix.vector.jobname}} - distro: ${{matrix.vector.pool}} + CI_JOB_IMAGE: ${{matrix.vector.pool}} TEST_OUTPUT_DIRECTORY: ${{github.workspace}}/t runs-on: ${{matrix.vector.pool}} steps: @@ -342,27 +313,52 @@ jobs: fail-fast: false matrix: vector: + - jobname: linux-sha256 + image: ubuntu:rolling + cc: clang + - jobname: linux-reftable + image: ubuntu:rolling + cc: clang + - jobname: linux-gcc + image: ubuntu:20.04 + cc: gcc + cc_package: gcc-8 + - jobname: linux-TEST-vars + image: ubuntu:20.04 + cc: gcc + cc_package: gcc-8 + - jobname: linux-gcc-default + image: ubuntu:rolling + cc: gcc + - jobname: linux-leaks + image: ubuntu:rolling + cc: gcc + - jobname: linux-reftable-leaks + image: ubuntu:rolling + cc: gcc + - jobname: linux-asan-ubsan + image: ubuntu:rolling + cc: clang + - jobname: linux-meson + image: ubuntu:rolling + cc: gcc - jobname: linux-musl - image: alpine - distro: alpine-latest + image: alpine:latest # Supported until 2025-04-02. - jobname: linux32 image: i386/ubuntu:focal - distro: ubuntu32-20.04 - jobname: pedantic - image: fedora - distro: fedora-latest + image: fedora:latest # A RHEL 8 compatible distro. Supported until 2029-05-31. - jobname: almalinux-8 image: almalinux:8 - distro: almalinux-8 # Supported until 2026-08-31. - jobname: debian-11 image: debian:11 - distro: debian-11 env: jobname: ${{matrix.vector.jobname}} - distro: ${{matrix.vector.distro}} + CC: ${{matrix.vector.cc}} + CI_JOB_IMAGE: ${{matrix.vector.image}} runs-on: ubuntu-latest container: ${{matrix.vector.image}} steps: @@ -371,10 +367,12 @@ jobs: run: apt -q update && apt -q -y install libc6-amd64 lib64stdc++6 - uses: actions/checkout@v4 - run: ci/install-dependencies.sh - - run: ci/run-build-and-tests.sh + - run: useradd builder --create-home + - run: chown -R builder . + - run: sudo --preserve-env --set-home --user=builder ci/run-build-and-tests.sh - name: print test failures if: failure() && env.FAILED_TEST_ARTIFACTS != '' - run: ci/print-test-failures.sh + run: sudo --preserve-env --set-home --user=builder ci/print-test-failures.sh - name: Upload failed tests' directories if: failure() && env.FAILED_TEST_ARTIFACTS != '' uses: actions/upload-artifact@v4 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9254e01583..8ed3ff5f03 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,14 +36,11 @@ test:linux: fi parallel: matrix: - - jobname: linux-old - image: ubuntu:20.04 - CC: gcc - jobname: linux-sha256 - image: ubuntu:latest + image: ubuntu:rolling CC: clang - jobname: linux-reftable - image: ubuntu:latest + image: ubuntu:rolling CC: clang - jobname: linux-gcc image: ubuntu:20.04 @@ -54,23 +51,25 @@ test:linux: CC: gcc CC_PACKAGE: gcc-8 - jobname: linux-gcc-default - image: ubuntu:latest + image: ubuntu:rolling CC: gcc - jobname: linux-leaks - image: ubuntu:latest + image: ubuntu:rolling CC: gcc - jobname: linux-reftable-leaks - image: ubuntu:latest + image: ubuntu:rolling CC: gcc - jobname: linux-asan-ubsan - image: ubuntu:latest + image: ubuntu:rolling CC: clang - jobname: pedantic image: fedora:latest - jobname: linux-musl image: alpine:latest + - jobname: linux32 + image: i386/ubuntu:20.04 - jobname: linux-meson - image: ubuntu:latest + image: ubuntu:rolling CC: gcc artifacts: paths: diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh index d1cb9fa878..d5a959e25f 100755 --- a/ci/install-dependencies.sh +++ b/ci/install-dependencies.sh @@ -31,9 +31,9 @@ alpine-*) ;; fedora-*|almalinux-*) dnf -yq update >/dev/null && - dnf -yq install 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. export DEBIAN_FRONTEND=noninteractive @@ -42,7 +42,7 @@ ubuntu-*|ubuntu32-*|debian-*) SVN='libsvn-perl subversion' LANGUAGES='language-pack-is' ;; - ubuntu32-*) + i386/ubuntu-*) SVN= LANGUAGES='language-pack-is' ;; @@ -206,26 +206,7 @@ export TERM=${TERM:-dumb} # Clear MAKEFLAGS that may come from the outside world. export MAKEFLAGS= -if test -n "$SYSTEM_COLLECTIONURI" || test -n "$SYSTEM_TASKDEFINITIONSURI" -then - CI_TYPE=azure-pipelines - # We are running in Azure Pipelines - CI_BRANCH="$BUILD_SOURCEBRANCH" - CI_COMMIT="$BUILD_SOURCEVERSION" - CI_JOB_ID="$BUILD_BUILDID" - CI_JOB_NUMBER="$BUILD_BUILDNUMBER" - CI_OS_NAME="$(echo "$AGENT_OS" | tr A-Z a-z)" - test darwin != "$CI_OS_NAME" || CI_OS_NAME=osx - CI_REPO_SLUG="$(expr "$BUILD_REPOSITORY_URI" : '.*/\([^/]*/[^/]*\)$')" - CC="${CC:-gcc}" - - # use a subdirectory of the cache dir (because the file share is shared - # among *all* phases) - cache_dir="$HOME/test-cache/$SYSTEM_PHASENAME" - - GIT_TEST_OPTS="--write-junit-xml" - JOBS=10 -elif test true = "$GITHUB_ACTIONS" +if test true = "$GITHUB_ACTIONS" then CI_TYPE=github-actions CI_BRANCH="$GITHUB_REF" @@ -246,6 +227,8 @@ then GIT_TEST_OPTS="--github-workflow-markup" JOBS=10 + + distro=$(echo "$CI_JOB_IMAGE" | tr : -) elif test true = "$GITLAB_CI" then CI_TYPE=gitlab-ci @@ -267,7 +250,7 @@ then CI_OS_NAME=osx JOBS=$(nproc) ;; - *,alpine:*|*,fedora:*|*,ubuntu:*) + *,alpine:*|*,fedora:*|*,ubuntu:*|*,i386/ubuntu:*) CI_OS_NAME=linux JOBS=$(nproc) ;; @@ -345,14 +328,7 @@ ubuntu-*) fi MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/$PYTHON_PACKAGE" - case "$distro" in - ubuntu-16.04) - # Apache is too old for HTTP/2. - ;; - *) - export GIT_TEST_HTTPD=true - ;; - esac + export GIT_TEST_HTTPD=true # The Linux build installs the defined dependency versions below. # The OS X build installs much more recent versions, whichever diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh index 655687dd82..dc910e5160 100755 --- a/ci/print-test-failures.sh +++ b/ci/print-test-failures.sh @@ -39,11 +39,6 @@ do test_name="${test_name##*/}" trash_dir="trash directory.$test_name" case "$CI_TYPE" in - azure-pipelines) - mkdir -p failed-test-artifacts - mv "$trash_dir" failed-test-artifacts - continue - ;; github-actions) mkdir -p failed-test-artifacts echo "FAILED_TEST_ARTIFACTS=${TEST_OUTPUT_DIRECTORY:t}/failed-test-artifacts" >>$GITHUB_ENV diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh index dbb2e73bcd..8545cdfab5 100755 --- a/t/t0060-path-utils.sh +++ b/t/t0060-path-utils.sh @@ -592,17 +592,19 @@ test_lazy_prereq CAN_EXEC_IN_PWD ' ./git rev-parse ' +test_expect_success !VALGRIND,RUNTIME_PREFIX,CAN_EXEC_IN_PWD 'setup runtime prefix' ' + mkdir -p pretend/bin && + cp "$GIT_EXEC_PATH"/git$X pretend/bin/ +' + test_expect_success !VALGRIND,RUNTIME_PREFIX,CAN_EXEC_IN_PWD 'RUNTIME_PREFIX works' ' - mkdir -p pretend/bin pretend/libexec/git-core && + mkdir -p pretend/libexec/git-core && echo "echo HERE" | write_script pretend/libexec/git-core/git-here && - cp "$GIT_EXEC_PATH"/git$X pretend/bin/ && GIT_EXEC_PATH= ./pretend/bin/git here >actual && echo HERE >expect && test_cmp expect actual' test_expect_success !VALGRIND,RUNTIME_PREFIX,CAN_EXEC_IN_PWD '%(prefix)/ works' ' - mkdir -p pretend/bin && - cp "$GIT_EXEC_PATH"/git$X pretend/bin/ && git config yes.path "%(prefix)/yes" && GIT_EXEC_PATH= ./pretend/bin/git config --path yes.path >actual && echo "$(pwd)/pretend/yes" >expect && diff --git a/t/t7422-submodule-output.sh b/t/t7422-submodule-output.sh index f21e920367..023a5cbdc4 100755 --- a/t/t7422-submodule-output.sh +++ b/t/t7422-submodule-output.sh @@ -167,10 +167,45 @@ do done test_expect_success !MINGW 'git submodule status --recursive propagates SIGPIPE' ' - { git submodule status --recursive 2>err; echo $?>status; } | - grep -q X/S && - test_must_be_empty err && - test_match_signal 13 "$(cat status)" + # The test setup is somewhat involved because triggering a SIGPIPE is + # racy with buffered pipes. To avoid the raciness we thus need to make + # sure that the subprocess in question fills the buffers completely, + # which requires a couple thousand submodules in total. + test_when_finished "rm -rf submodule repo" && + git init submodule && + ( + cd submodule && + test_commit initial && + + COMMIT=$(git rev-parse HEAD) && + for i in $(test_seq 2000) + do + printf "[submodule \"sm-$i\"]\npath = recursive-submodule-path-$i\n" "$i" || + return 1 + done >gitmodules && + BLOB=$(git hash-object -w --stdin <gitmodules) && + + printf "100644 blob $BLOB\t.gitmodules\n" >tree && + for i in $(test_seq 2000) + do + printf "160000 commit $COMMIT\trecursive-submodule-path-%d\n" "$i" || + return 1 + done >>tree && + TREE=$(git mktree <tree) && + + COMMIT=$(git commit-tree "$TREE") && + git reset --hard "$COMMIT" + ) && + + git init repo && + ( + cd repo && + GIT_ALLOW_PROTOCOL=file git submodule add "$(pwd)"/../submodule && + { git submodule status --recursive 2>err; echo $?>status; } | + grep -q recursive-submodule-path-1 && + test_must_be_empty err && + test_match_signal 13 "$(cat status)" + ) ' test_done |
