Skip to content

Commit 3ab3741

Browse files
committed
Allow changing the PHP version for CI tests
Both useful for the integration & unit tests.
1 parent 5d49dfe commit 3ab3741

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.github/jobs/baseinstall.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44

55
export version="$1"
66
db=${2:-install}
7+
phpversion="${3}"
78

89
set -eux
910

11+
if [ -z "$phpversion" ]; then
1012
PHPVERSION=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION."\n";')
11-
export PHPVERSION
13+
fi
14+
15+
show_phpinfo "$PHPVERSION"
1216

1317
section_start "Run composer"
1418
export APP_ENV="dev"

.github/jobs/ci_settings.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ mysql_user () {
3434
echo "$1" | mysql -udomjudge -pdomjudge ${2:-} | tee -a "$ARTIFACTS"/mysql.txt
3535
}
3636

37+
show_phpinfo() {
38+
phpversion=$1
39+
section_start "Show the new PHP info"
40+
update-alternatives --set php /usr/bin/php"${phpversion}"
41+
php -v
42+
php -m
43+
section_end
44+
}
45+
3746
section_start () {
3847
if [ "$#" -ne 1 ]; then
3948
echo "Only 1 argument is needed for GHA, 2 was needed for GitLab."

0 commit comments

Comments
 (0)