Skip to content

Commit

Permalink
Merge branch 'ps/ci-misc-updates' into seen
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
gitster committed Jan 3, 2025
2 parents 760f0c2 + 3f4f7d4 commit bac83d3
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 89 deletions.
70 changes: 34 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +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-breaking-changes
cc: gcc
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
Expand All @@ -284,23 +271,11 @@ jobs:
- jobname: osx-meson
cc: clang
pool: macos-13
- 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:
Expand Down Expand Up @@ -338,27 +313,48 @@ jobs:
fail-fast: false
matrix:
vector:
- jobname: linux-sha256
image: ubuntu:rolling
cc: clang
- jobname: linux-reftable
image: ubuntu:rolling
cc: clang
- jobname: linux-TEST-vars
image: ubuntu:20.04
cc: gcc
cc_package: gcc-8
- jobname: linux-breaking-changes
cc: gcc
image: ubuntu:rolling
- 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:
Expand All @@ -367,10 +363,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
Expand Down
17 changes: 8 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-breaking-changes
image: ubuntu:20.04
Expand All @@ -53,20 +50,22 @@ test:linux:
CC: gcc
CC_PACKAGE: gcc-8
- 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:
Expand Down
6 changes: 3 additions & 3 deletions ci/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -42,7 +42,7 @@ ubuntu-*|ubuntu32-*|debian-*)
SVN='libsvn-perl subversion'
LANGUAGES='language-pack-is'
;;
ubuntu32-*)
i386/ubuntu-*)
SVN=
LANGUAGES='language-pack-is'
;;
Expand Down
34 changes: 5 additions & 29 deletions ci/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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)
;;
Expand Down Expand Up @@ -340,14 +323,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
Expand Down
5 changes: 0 additions & 5 deletions ci/print-test-failures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions t/t0060-path-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
10 changes: 7 additions & 3 deletions t/t7422-submodule-output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,13 @@ 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_lazy_prereq STDBUF '
stdbuf --version
'

test_expect_success !MINGW,STDBUF 'git submodule status --recursive propagates SIGPIPE' '
{ stdbuf -oL git submodule status --recursive 2>err; echo $?>status; } |
stdbuf -i0 grep -q X/S &&
test_must_be_empty err &&
test_match_signal 13 "$(cat status)"
'
Expand Down

0 comments on commit bac83d3

Please sign in to comment.