Skip to content

Commit f05fb35

Browse files
avargitster
authored andcommitted
CI: combine ci/install{,-docker}-dependencies.sh
Combine the "ci/install-dependencies.sh" and "ci/install-docker-dependencies.sh" into one script. The "case" statement in the latter only cared about "$jobname", and can be folded into the same "case" statement in the former. The reason they split up is historical, and because the "ci/install-dependencies.sh" used "ci/lib.sh", which requires "bash". At least one of the docker containers doesn't have "bash". To make the existing code POSIX-compatible we need to replace pushd/popd with a sub-shell, but no other changes were needed. This also fixes issue in "ci/install-docker-dependencies.sh" where we'd hide errors due to not using "set -e". Now that we include "ci/lib.sh" we won't have that potential issue. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent c782c3e commit f05fb35

File tree

3 files changed

+23
-28
lines changed

3 files changed

+23
-28
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ jobs:
311311
container: ${{matrix.vector.image}}
312312
steps:
313313
- uses: actions/checkout@v1
314-
- run: ci/install-docker-dependencies.sh
314+
- run: ci/install-dependencies.sh
315315
- run: ci/lib.sh
316316
- run: make
317317
- run: make test

ci/install-dependencies.sh

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/sh
22
#
33
# Install dependencies required to build and test Git on Linux and macOS
44
#
@@ -34,18 +34,20 @@ ubuntu-latest)
3434
sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
3535
$UBUNTU_COMMON_PKGS $CC_PACKAGE
3636
mkdir --parents "$P4_PATH"
37-
pushd "$P4_PATH"
37+
(
38+
cd "$P4_PATH"
3839
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
3940
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4"
4041
chmod u+x p4d
4142
chmod u+x p4
42-
popd
43+
)
4344
mkdir --parents "$GIT_LFS_PATH"
44-
pushd "$GIT_LFS_PATH"
45+
(
46+
cd "$GIT_LFS_PATH"
4547
wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
4648
tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
4749
cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
48-
popd
50+
)
4951
;;
5052
macos-latest)
5153
export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
@@ -90,6 +92,21 @@ linux-gcc-default)
9092
sudo apt-get -q update
9193
sudo apt-get -q -y install $UBUNTU_COMMON_PKGS
9294
;;
95+
linux32)
96+
linux32 --32bit i386 sh -c '
97+
apt update >/dev/null &&
98+
apt install -y build-essential libcurl4-openssl-dev \
99+
libssl-dev libexpat-dev gettext python >/dev/null
100+
'
101+
;;
102+
linux-musl)
103+
apk add --update build-base curl-dev openssl-dev expat-dev gettext \
104+
pcre2-dev python3 musl-libintl perl-utils ncurses >/dev/null
105+
;;
106+
pedantic)
107+
dnf -yq update >/dev/null &&
108+
dnf -yq install make gcc findutils diffutils perl python3 gettext zlib-devel expat-devel openssl-devel curl-devel pcre2-devel >/dev/null
109+
;;
93110
esac
94111

95112
if type p4d >/dev/null && type p4 >/dev/null

ci/install-docker-dependencies.sh

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

0 commit comments

Comments
 (0)