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
This commit is contained in:
78
.github/workflows/main.yml
vendored
78
.github/workflows/main.yml
vendored
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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'
|
||||
;;
|
||||
|
34
ci/lib.sh
34
ci/lib.sh
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 &&
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user