Skip to content

Commit 9cdeb34

Browse files
pks-tgitster
authored andcommitted
ci: merge scripts which install dependencies
We have two different scripts which install dependencies, one for dockerized jobs and one for non-dockerized ones. Naturally, these scripts have quite some duplication. Furthermore, either of these scripts is missing some test dependencies that the respective other script has, thus reducing test coverage. Merge those two scripts such that there is a single source of truth for test dependencies, only. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2c5c763 commit 9cdeb34

File tree

4 files changed

+31
-53
lines changed

4 files changed

+31
-53
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ jobs:
359359
if: matrix.vector.jobname != 'linux32'
360360
- uses: actions/checkout@v1 # cannot be upgraded because Node.js Actions aren't supported in this container
361361
if: matrix.vector.jobname == 'linux32'
362-
- run: ci/install-docker-dependencies.sh
362+
- run: ci/install-dependencies.sh
363363
- run: ci/run-build-and-tests.sh
364364
- name: print test failures
365365
if: failure() && env.FAILED_TEST_ARTIFACTS != ''

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test:linux:
1212
variables:
1313
CUSTOM_PATH: "/custom"
1414
before_script:
15-
- ./ci/install-docker-dependencies.sh
15+
- ./ci/install-dependencies.sh
1616
script:
1717
- useradd builder --create-home
1818
- chown -R builder "${CI_PROJECT_DIR}"
@@ -100,7 +100,7 @@ static-analysis:
100100
variables:
101101
jobname: StaticAnalysis
102102
before_script:
103-
- ./ci/install-docker-dependencies.sh
103+
- ./ci/install-dependencies.sh
104104
script:
105105
- ./ci/run-static-analysis.sh
106106
- ./ci/check-directional-formatting.bash

ci/install-dependencies.sh

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
. ${0%/*}/lib.sh
77

8+
begin_group "Install dependencies"
9+
810
P4WHENCE=https://cdist2.perforce.com/perforce/r21.2
911
LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
1012

@@ -20,14 +22,27 @@ then
2022
fi
2123

2224
case "$distro" in
25+
alpine-*)
26+
apk add --update shadow sudo build-base curl-dev openssl-dev expat-dev gettext \
27+
pcre2-dev python3 musl-libintl perl-utils ncurses \
28+
apache2 apache2-http2 apache2-proxy apache2-ssl apache2-webdav apr-util-dbd_sqlite3 \
29+
bash cvs gnupg perl-cgi perl-dbd-sqlite >/dev/null
30+
;;
31+
fedora-*)
32+
dnf -yq update >/dev/null &&
33+
dnf -yq install make gcc findutils diffutils perl python3 gettext zlib-devel expat-devel openssl-devel curl-devel pcre2-devel >/dev/null
34+
;;
2335
ubuntu-*)
36+
# Required so that apt doesn't wait for user input on certain packages.
37+
export DEBIAN_FRONTEND=noninteractive
38+
2439
sudo apt-get -q update
2540
sudo apt-get -q -y install \
26-
language-pack-is libsvn-perl apache2 \
27-
make libssl-dev libcurl4-openssl-dev libexpat-dev \
41+
language-pack-is libsvn-perl apache2 cvs cvsps git gnupg subversion \
42+
make libssl-dev libcurl4-openssl-dev libexpat-dev wget sudo \
2843
tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl \
29-
libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl \
30-
$CC_PACKAGE $PYTHON_PACKAGE
44+
libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl libdbd-sqlite3-perl libcgi-pm-perl \
45+
${CC_PACKAGE:-${CC:-gcc}} $PYTHON_PACKAGE
3146

3247
mkdir --parents "$CUSTOM_PATH"
3348
wget --quiet --directory-prefix="$CUSTOM_PATH" \
@@ -39,6 +54,13 @@ ubuntu-*)
3954
-C "$CUSTOM_PATH" --strip-components=1 "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs"
4055
rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
4156
;;
57+
ubuntu32-*)
58+
sudo linux32 --32bit i386 sh -c '
59+
apt update >/dev/null &&
60+
apt install -y build-essential libcurl4-openssl-dev \
61+
libssl-dev libexpat-dev gettext python >/dev/null
62+
'
63+
;;
4264
macos-*)
4365
export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
4466
# Uncomment this if you want to run perf tests:
@@ -98,3 +120,5 @@ then
98120
else
99121
echo >&2 "WARNING: git-lfs wasn't installed, see above for clues why"
100122
fi
123+
124+
end_group "Install dependencies"

ci/install-docker-dependencies.sh

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)