Skip to content

Commit 8f7f672

Browse files
committed
Use Bash for all GitHub Actions CI jobs
We didn't catch an error with an error being eaten away with a piped command. The benefits of being POSIX compliant are slim for the CI jobs. The -o pipefail is added for al scripts (also if they don't use a `|` yet) and where we don't have set -eu yet this is added but not the -x to keep the looks the same. Also fixes an unset ARCH option.
1 parent 7003975 commit 8f7f672

8 files changed

+22
-10
lines changed

.github/jobs/baseinstall.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
. .github/jobs/ci_settings.sh
44

@@ -13,7 +13,7 @@ export APP_ENV="${4:-prod}"
1313

1414
MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
1515

16-
set -eux
16+
set -euxo pipefail
1717

1818
if [ -z "$phpversion" ]; then
1919
phpversion=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION."\n";')

.github/jobs/chroot_checks.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
. .github/jobs/ci_settings.sh
44

55
if [ -n "$1" ] && [ "$1" != "default" ]; then
6-
export ARCH="$1"
6+
export ARCH_OPTION="-a $1"
7+
else
8+
export ARCH_OPTION=""
79
fi
810

911
function finish() {
@@ -20,6 +22,8 @@ FAILED=0
2022

2123
trap finish EXIT
2224

25+
set -euo pipefail
26+
2327
DIR=$PWD
2428
section_start "Debug info"
2529
lsb_release -a | tee -a "$ARTIFACTS/debug-info"
@@ -44,7 +48,7 @@ cd /opt/domjudge/judgehost/bin || exit 1
4448
section_end chroot
4549

4650
section_start "Show minimal chroot"
47-
./dj_make_chroot -a "$ARCH" | tee -a "$ARTIFACTS"/chroot.log
51+
./dj_make_chroot $ARCH_OPTION | tee -a "$ARTIFACTS"/chroot.log
4852
section_end
4953

5054
section_start "Test chroot contents"

.github/jobs/composer_setup.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

3-
set -eux
3+
set -euxo pipefail
44

55
. .github/jobs/ci_settings.sh
66

.github/jobs/configure-checks/setup_configure_image.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

3-
set -eux
3+
set -euxo pipefail
44

55
distro_id=$(grep "^ID=" /etc/os-release)
66

.github/jobs/fix_pipelinecomponents_image.sh

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/sh
22

3+
# We can't convert this script to bash as GHA doesn't have bash installed
4+
#
5+
# The current script doesn't use a piped command so the "benefit" of using
6+
# pipefail is not there over the hassle of maintaining another container.
37
set -eux
48

59
echo "Set plugin config for version detection"

.github/jobs/getapi.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

3-
set -eux
3+
set -euxo pipefail
44

55
# Ignore the CLICS API strict mode
66
sudo sed -i "s/'strict'/'ignore-clics'/g" /opt/domjudge/domserver/webapp/src/Controller/API/AbstractRestController.php

.github/jobs/unit-tests.sh

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
. .github/jobs/ci_settings.sh
44

5+
set -euo pipefail
6+
57
DIR="$PWD"
68

79
export version=$1

.github/jobs/webstandard.sh

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
. .github/jobs/ci_settings.sh
44

5+
set -euo pipefail
6+
57
DIR="$PWD"
68

79
if [ "$#" -ne "2" ]; then

0 commit comments

Comments
 (0)