Skip to content

Commit 0dfbd27

Browse files
committed
Update test env installation
1 parent 5b92235 commit 0dfbd27

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ before_install:
1818
1919
install:
2020
- composer install --no-interaction
21+
- ./ci/test-env-install.sh
2122

2223
before_script:
2324
- composer validate

ci/test-env-install.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
function setup_test_requirements() {
2+
# Adding software-properties-common for add-apt-repository.
3+
apt-get install -y software-properties-common
4+
# Adding ondrej/php repository for installing php, this works for all ubuntu flavours.
5+
add-apt-repository -y ppa:ondrej/php
6+
apt-get update
7+
# Installing php-cli, which is the minimum requirement to run EasyEngine
8+
apt-get -y install php7.2-cli
9+
10+
php_modules=( pcntl curl sqlite3 )
11+
if command -v php > /dev/null 2>&1; then
12+
# Reading the php version.
13+
default_php_version="$(readlink -f /usr/bin/php | gawk -F "php" '{ print $2}')"
14+
for module in "${php_modules[@]}"; do
15+
if ! php -m | grep $module >> $LOG_FILE 2>&1; then
16+
echo "$module not installed. Installing..."
17+
apt install -y php$default_php_version-$module
18+
else
19+
echo "$module is already installed"
20+
fi
21+
done
22+
fi
23+
}
24+
25+
setup_test_requirements

0 commit comments

Comments
 (0)