Skip to content

Commit 2bf3c7f

Browse files
committed
Merge branch 'ps/ci-misc-updates'
CI updates (containerization, dropping stale ones, etc.). * 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
2 parents bc204b7 + e39e332 commit 2bf3c7f

File tree

7 files changed

+95
-90
lines changed

7 files changed

+95
-90
lines changed

.github/workflows/main.yml

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -311,19 +311,6 @@ jobs:
311311
fail-fast: false
312312
matrix:
313313
vector:
314-
- jobname: linux-sha256
315-
cc: clang
316-
pool: ubuntu-latest
317-
- jobname: linux-reftable
318-
cc: clang
319-
pool: ubuntu-latest
320-
- jobname: linux-breaking-changes
321-
cc: gcc
322-
pool: ubuntu-20.04
323-
- jobname: linux-TEST-vars
324-
cc: gcc
325-
cc_package: gcc-8
326-
pool: ubuntu-20.04
327314
- jobname: osx-clang
328315
cc: clang
329316
pool: macos-13
@@ -336,23 +323,11 @@ jobs:
336323
- jobname: osx-meson
337324
cc: clang
338325
pool: macos-13
339-
- jobname: linux-leaks
340-
cc: gcc
341-
pool: ubuntu-latest
342-
- jobname: linux-reftable-leaks
343-
cc: gcc
344-
pool: ubuntu-latest
345-
- jobname: linux-asan-ubsan
346-
cc: clang
347-
pool: ubuntu-latest
348-
- jobname: linux-meson
349-
cc: gcc
350-
pool: ubuntu-latest
351326
env:
352327
CC: ${{matrix.vector.cc}}
353328
CC_PACKAGE: ${{matrix.vector.cc_package}}
354329
jobname: ${{matrix.vector.jobname}}
355-
distro: ${{matrix.vector.pool}}
330+
CI_JOB_IMAGE: ${{matrix.vector.pool}}
356331
TEST_OUTPUT_DIRECTORY: ${{github.workspace}}/t
357332
runs-on: ${{matrix.vector.pool}}
358333
steps:
@@ -390,27 +365,48 @@ jobs:
390365
fail-fast: false
391366
matrix:
392367
vector:
368+
- jobname: linux-sha256
369+
image: ubuntu:rolling
370+
cc: clang
371+
- jobname: linux-reftable
372+
image: ubuntu:rolling
373+
cc: clang
374+
- jobname: linux-TEST-vars
375+
image: ubuntu:20.04
376+
cc: gcc
377+
cc_package: gcc-8
378+
- jobname: linux-breaking-changes
379+
cc: gcc
380+
image: ubuntu:rolling
381+
- jobname: linux-leaks
382+
image: ubuntu:rolling
383+
cc: gcc
384+
- jobname: linux-reftable-leaks
385+
image: ubuntu:rolling
386+
cc: gcc
387+
- jobname: linux-asan-ubsan
388+
image: ubuntu:rolling
389+
cc: clang
390+
- jobname: linux-meson
391+
image: ubuntu:rolling
392+
cc: gcc
393393
- jobname: linux-musl
394-
image: alpine
395-
distro: alpine-latest
394+
image: alpine:latest
396395
# Supported until 2025-04-02.
397396
- jobname: linux32
398397
image: i386/ubuntu:focal
399-
distro: ubuntu32-20.04
400398
- jobname: pedantic
401-
image: fedora
402-
distro: fedora-latest
399+
image: fedora:latest
403400
# A RHEL 8 compatible distro. Supported until 2029-05-31.
404401
- jobname: almalinux-8
405402
image: almalinux:8
406-
distro: almalinux-8
407403
# Supported until 2026-08-31.
408404
- jobname: debian-11
409405
image: debian:11
410-
distro: debian-11
411406
env:
412407
jobname: ${{matrix.vector.jobname}}
413-
distro: ${{matrix.vector.distro}}
408+
CC: ${{matrix.vector.cc}}
409+
CI_JOB_IMAGE: ${{matrix.vector.image}}
414410
runs-on: ubuntu-latest
415411
container: ${{matrix.vector.image}}
416412
steps:
@@ -419,10 +415,12 @@ jobs:
419415
run: apt -q update && apt -q -y install libc6-amd64 lib64stdc++6
420416
- uses: actions/checkout@v4
421417
- run: ci/install-dependencies.sh
422-
- run: ci/run-build-and-tests.sh
418+
- run: useradd builder --create-home
419+
- run: chown -R builder .
420+
- run: sudo --preserve-env --set-home --user=builder ci/run-build-and-tests.sh
423421
- name: print test failures
424422
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
425-
run: ci/print-test-failures.sh
423+
run: sudo --preserve-env --set-home --user=builder ci/print-test-failures.sh
426424
- name: Upload failed tests' directories
427425
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
428426
uses: actions/upload-artifact@v4

.gitlab-ci.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,11 @@ test:linux:
3636
fi
3737
parallel:
3838
matrix:
39-
- jobname: linux-old
40-
image: ubuntu:20.04
41-
CC: gcc
4239
- jobname: linux-sha256
43-
image: ubuntu:latest
40+
image: ubuntu:rolling
4441
CC: clang
4542
- jobname: linux-reftable
46-
image: ubuntu:latest
43+
image: ubuntu:rolling
4744
CC: clang
4845
- jobname: linux-breaking-changes
4946
image: ubuntu:20.04
@@ -53,20 +50,22 @@ test:linux:
5350
CC: gcc
5451
CC_PACKAGE: gcc-8
5552
- jobname: linux-leaks
56-
image: ubuntu:latest
53+
image: ubuntu:rolling
5754
CC: gcc
5855
- jobname: linux-reftable-leaks
59-
image: ubuntu:latest
56+
image: ubuntu:rolling
6057
CC: gcc
6158
- jobname: linux-asan-ubsan
62-
image: ubuntu:latest
59+
image: ubuntu:rolling
6360
CC: clang
6461
- jobname: pedantic
6562
image: fedora:latest
6663
- jobname: linux-musl
6764
image: alpine:latest
65+
- jobname: linux32
66+
image: i386/ubuntu:20.04
6867
- jobname: linux-meson
69-
image: ubuntu:latest
68+
image: ubuntu:rolling
7069
CC: gcc
7170
artifacts:
7271
paths:

ci/install-dependencies.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ alpine-*)
3131
;;
3232
fedora-*|almalinux-*)
3333
dnf -yq update >/dev/null &&
34-
dnf -yq install make gcc findutils diffutils perl python3 gettext zlib-devel expat-devel openssl-devel curl-devel pcre2-devel >/dev/null
34+
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
3535
;;
36-
ubuntu-*|ubuntu32-*|debian-*)
36+
ubuntu-*|i386/ubuntu-*|debian-*)
3737
# Required so that apt doesn't wait for user input on certain packages.
3838
export DEBIAN_FRONTEND=noninteractive
3939

@@ -42,7 +42,7 @@ ubuntu-*|ubuntu32-*|debian-*)
4242
SVN='libsvn-perl subversion'
4343
LANGUAGES='language-pack-is'
4444
;;
45-
ubuntu32-*)
45+
i386/ubuntu-*)
4646
SVN=
4747
LANGUAGES='language-pack-is'
4848
;;

ci/lib.sh

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -206,26 +206,7 @@ export TERM=${TERM:-dumb}
206206
# Clear MAKEFLAGS that may come from the outside world.
207207
export MAKEFLAGS=
208208

209-
if test -n "$SYSTEM_COLLECTIONURI" || test -n "$SYSTEM_TASKDEFINITIONSURI"
210-
then
211-
CI_TYPE=azure-pipelines
212-
# We are running in Azure Pipelines
213-
CI_BRANCH="$BUILD_SOURCEBRANCH"
214-
CI_COMMIT="$BUILD_SOURCEVERSION"
215-
CI_JOB_ID="$BUILD_BUILDID"
216-
CI_JOB_NUMBER="$BUILD_BUILDNUMBER"
217-
CI_OS_NAME="$(echo "$AGENT_OS" | tr A-Z a-z)"
218-
test darwin != "$CI_OS_NAME" || CI_OS_NAME=osx
219-
CI_REPO_SLUG="$(expr "$BUILD_REPOSITORY_URI" : '.*/\([^/]*/[^/]*\)$')"
220-
CC="${CC:-gcc}"
221-
222-
# use a subdirectory of the cache dir (because the file share is shared
223-
# among *all* phases)
224-
cache_dir="$HOME/test-cache/$SYSTEM_PHASENAME"
225-
226-
GIT_TEST_OPTS="--write-junit-xml"
227-
JOBS=10
228-
elif test true = "$GITHUB_ACTIONS"
209+
if test true = "$GITHUB_ACTIONS"
229210
then
230211
CI_TYPE=github-actions
231212
CI_BRANCH="$GITHUB_REF"
@@ -246,6 +227,8 @@ then
246227

247228
GIT_TEST_OPTS="--github-workflow-markup"
248229
JOBS=10
230+
231+
distro=$(echo "$CI_JOB_IMAGE" | tr : -)
249232
elif test true = "$GITLAB_CI"
250233
then
251234
CI_TYPE=gitlab-ci
@@ -267,7 +250,7 @@ then
267250
CI_OS_NAME=osx
268251
JOBS=$(nproc)
269252
;;
270-
*,alpine:*|*,fedora:*|*,ubuntu:*)
253+
*,alpine:*|*,fedora:*|*,ubuntu:*|*,i386/ubuntu:*)
271254
CI_OS_NAME=linux
272255
JOBS=$(nproc)
273256
;;
@@ -340,14 +323,7 @@ ubuntu-*)
340323
fi
341324
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/$PYTHON_PACKAGE"
342325

343-
case "$distro" in
344-
ubuntu-16.04)
345-
# Apache is too old for HTTP/2.
346-
;;
347-
*)
348-
export GIT_TEST_HTTPD=true
349-
;;
350-
esac
326+
export GIT_TEST_HTTPD=true
351327

352328
# The Linux build installs the defined dependency versions below.
353329
# The OS X build installs much more recent versions, whichever

ci/print-test-failures.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ do
3939
test_name="${test_name##*/}"
4040
trash_dir="trash directory.$test_name"
4141
case "$CI_TYPE" in
42-
azure-pipelines)
43-
mkdir -p failed-test-artifacts
44-
mv "$trash_dir" failed-test-artifacts
45-
continue
46-
;;
4742
github-actions)
4843
mkdir -p failed-test-artifacts
4944
echo "FAILED_TEST_ARTIFACTS=${TEST_OUTPUT_DIRECTORY:t}/failed-test-artifacts" >>$GITHUB_ENV

t/t0060-path-utils.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,17 +592,19 @@ test_lazy_prereq CAN_EXEC_IN_PWD '
592592
./git rev-parse
593593
'
594594

595+
test_expect_success !VALGRIND,RUNTIME_PREFIX,CAN_EXEC_IN_PWD 'setup runtime prefix' '
596+
mkdir -p pretend/bin &&
597+
cp "$GIT_EXEC_PATH"/git$X pretend/bin/
598+
'
599+
595600
test_expect_success !VALGRIND,RUNTIME_PREFIX,CAN_EXEC_IN_PWD 'RUNTIME_PREFIX works' '
596-
mkdir -p pretend/bin pretend/libexec/git-core &&
601+
mkdir -p pretend/libexec/git-core &&
597602
echo "echo HERE" | write_script pretend/libexec/git-core/git-here &&
598-
cp "$GIT_EXEC_PATH"/git$X pretend/bin/ &&
599603
GIT_EXEC_PATH= ./pretend/bin/git here >actual &&
600604
echo HERE >expect &&
601605
test_cmp expect actual'
602606

603607
test_expect_success !VALGRIND,RUNTIME_PREFIX,CAN_EXEC_IN_PWD '%(prefix)/ works' '
604-
mkdir -p pretend/bin &&
605-
cp "$GIT_EXEC_PATH"/git$X pretend/bin/ &&
606608
git config yes.path "%(prefix)/yes" &&
607609
GIT_EXEC_PATH= ./pretend/bin/git config --path yes.path >actual &&
608610
echo "$(pwd)/pretend/yes" >expect &&

t/t7422-submodule-output.sh

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,45 @@ do
167167
done
168168

169169
test_expect_success !MINGW 'git submodule status --recursive propagates SIGPIPE' '
170-
{ git submodule status --recursive 2>err; echo $?>status; } |
171-
grep -q X/S &&
172-
test_must_be_empty err &&
173-
test_match_signal 13 "$(cat status)"
170+
# The test setup is somewhat involved because triggering a SIGPIPE is
171+
# racy with buffered pipes. To avoid the raciness we thus need to make
172+
# sure that the subprocess in question fills the buffers completely,
173+
# which requires a couple thousand submodules in total.
174+
test_when_finished "rm -rf submodule repo" &&
175+
git init submodule &&
176+
(
177+
cd submodule &&
178+
test_commit initial &&
179+
180+
COMMIT=$(git rev-parse HEAD) &&
181+
for i in $(test_seq 2000)
182+
do
183+
printf "[submodule \"sm-$i\"]\npath = recursive-submodule-path-$i\n" "$i" ||
184+
return 1
185+
done >gitmodules &&
186+
BLOB=$(git hash-object -w --stdin <gitmodules) &&
187+
188+
printf "100644 blob $BLOB\t.gitmodules\n" >tree &&
189+
for i in $(test_seq 2000)
190+
do
191+
printf "160000 commit $COMMIT\trecursive-submodule-path-%d\n" "$i" ||
192+
return 1
193+
done >>tree &&
194+
TREE=$(git mktree <tree) &&
195+
196+
COMMIT=$(git commit-tree "$TREE") &&
197+
git reset --hard "$COMMIT"
198+
) &&
199+
200+
git init repo &&
201+
(
202+
cd repo &&
203+
GIT_ALLOW_PROTOCOL=file git submodule add "$(pwd)"/../submodule &&
204+
{ git submodule status --recursive 2>err; echo $?>status; } |
205+
grep -q recursive-submodule-path-1 &&
206+
test_must_be_empty err &&
207+
test_match_signal 13 "$(cat status)"
208+
)
174209
'
175210

176211
test_done

0 commit comments

Comments
 (0)