Skip to content

Commit 6930c26

Browse files
committed
We need PHPversion in both scripts
Displaying the PHPconfig makes more sense in the shared setup script.
1 parent 0d047b4 commit 6930c26

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

.github/jobs/baseinstall.sh

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

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

911
MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
1012

11-
# If this script is called from unit-tests.sh, we use the test environment
12-
export APP_ENV="${3:-prod}"
13-
1413
# In the test environment, we need to use a different database
1514
[ "$APP_ENV" = "prod" ] && DATABASE_NAME=domjudge || DATABASE_NAME=domjudge_test
1615

1716
set -eux
1817

1918
if [ -z "$phpversion" ]; then
20-
PHPVERSION=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION."\n";')
19+
phpversion=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION."\n";')
2120
fi
2221

23-
show_phpinfo "$PHPVERSION"
22+
show_phpinfo "$phpversion"
2423

2524
section_start "Run composer"
2625
export APP_ENV="dev"
@@ -108,7 +107,7 @@ cp /proc/cmdline "$ARTIFACTS"/cmdline.txt
108107
section_end
109108

110109
section_start "Setup webserver"
111-
cp /opt/domjudge/domserver/etc/domjudge-fpm.conf /etc/php/"$PHPVERSION"/fpm/pool.d/domjudge.conf
110+
cp /opt/domjudge/domserver/etc/domjudge-fpm.conf /etc/php/"$phpversion"/fpm/pool.d/domjudge.conf
112111

113112
rm -f /etc/nginx/sites-enabled/*
114113
cp /opt/domjudge/domserver/etc/nginx-conf /etc/nginx/sites-enabled/domjudge
@@ -122,7 +121,7 @@ nginx -t
122121
section_end
123122

124123
section_start "Show webserver is up"
125-
for service in nginx php${PHPVERSION}-fpm; do
124+
for service in nginx php${phpversion}-fpm; do
126125
service "$service" restart
127126
service "$service" status
128127
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
@@ -50,7 +50,7 @@ jobs:
5050
- name: pstree
5151
run: pstree -p
5252
- name: Install DOMjudge
53-
run: .github/jobs/baseinstall.sh unit install test
53+
run: .github/jobs/baseinstall.sh unit install ${{ matrix.PHPVERSION }} test
5454
- name: Check nginx
5555
run: curl -v https://localhost/domjudge/
5656
- name: Run the unit-tests

0 commit comments

Comments
 (0)