Skip to content

Commit e3e07f8

Browse files
committed
Allow changing the PHP version for CI tests
Both useful for the integration & unit tests.
1 parent b0ebb1c commit e3e07f8

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,13 +4,17 @@
44

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

89
MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
910

1011
set -eux
1112

13+
if [ -z "$phpversion" ]; then
1214
PHPVERSION=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION."\n";')
13-
export PHPVERSION
15+
fi
16+
17+
show_phpinfo "$PHPVERSION"
1418

1519
section_start "Run composer"
1620
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)