Skip to content

Commit 1e35844

Browse files
committed
We need PHPversion in both scripts
Displaying the PHPconfig makes more sense in the shared setup script.
1 parent 49d4452 commit 1e35844

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

.github/jobs/baseinstall.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,24 @@
44

55
export version="$1"
66
db=${2:-install}
7-
phpversion="${3}"
7+
phpversion="${3:-8.1}"
8+
# If this script is called from unit-tests.sh, we use the test environment
9+
export APP_ENV="${4:-prod}"
810

9-
MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
11+
show_phpinfo $phpversion
1012

11-
# If this script is called from unit-tests.sh, we use the test environment
12-
export APP_ENV="${3:-prod}"
13+
MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
1314

1415
# In the test environment, we need to use a different database
1516
[ "$APP_ENV" = "prod" ] && DATABASE_NAME=domjudge || DATABASE_NAME=domjudge_test
1617

1718
set -eux
1819

1920
if [ -z "$phpversion" ]; then
20-
PHPVERSION=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION."\n";')
21+
phpversion=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION."\n";')
2122
fi
2223

23-
show_phpinfo "$PHPVERSION"
24+
show_phpinfo "$phpversion"
2425

2526
section_start "Run composer"
2627
export APP_ENV="dev"
@@ -105,7 +106,7 @@ cp /proc/cmdline "$ARTIFACTS"/cmdline.txt
105106
section_end
106107

107108
section_start "Setup webserver"
108-
cp /opt/domjudge/domserver/etc/domjudge-fpm.conf /etc/php/"$PHPVERSION"/fpm/pool.d/domjudge.conf
109+
cp /opt/domjudge/domserver/etc/domjudge-fpm.conf /etc/php/"$phpversion"/fpm/pool.d/domjudge.conf
109110

110111
rm -f /etc/nginx/sites-enabled/*
111112
cp /opt/domjudge/domserver/etc/nginx-conf /etc/nginx/sites-enabled/domjudge
@@ -119,7 +120,7 @@ nginx -t
119120
section_end
120121

121122
section_start "Show webserver is up"
122-
for service in nginx php${PHPVERSION}-fpm; do
123+
for service in nginx php${phpversion}-fpm; do
123124
service "$service" restart
124125
service "$service" status
125126
done

.github/jobs/unit-tests.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ export version=$1
88
unittest=$2
99
[ "$version" = "8.1" ] && CODECOVERAGE=1 || CODECOVERAGE=0
1010

11-
show_phpinfo $version
12-
1311
# Set up
1412
export unit=1
1513

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: pstree
5252
run: pstree -p
5353
- name: Install DOMjudge
54-
run: .github/jobs/baseinstall.sh unit install test
54+
run: .github/jobs/baseinstall.sh unit install ${{ matrix.PHPVERSION }} test
5555
- name: Check nginx
5656
run: curl -v https://localhost/domjudge/
5757
- name: Run the unit-tests

0 commit comments

Comments
 (0)