forked from quizlet/hammock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.sh
executable file
·36 lines (31 loc) · 862 Bytes
/
.travis.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
set -ex
apt update -y
DEBIAN_FRONTEND=noninteractive apt install -y php-cli zip unzip
hhvm --version
php --version
(
cd $(mktemp -d)
curl https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
)
canruntests=$(hhvm --php -r "echo HHVM_VERSION_ID >= 32800 ? 'yes' : 'no';")
if [ "$canruntests" = "yes" ]; then
rm composer.json
mv composer.dev.json composer.json
else
# The tests won't typecheck and work, so we remove them.
rm -r tests
# hhvm-autoload needs to have a directory here, but it can be empty.
mkdir tests
fi
runtime=$(hhvm --php -r "echo HHVM_VERSION_ID >= 40000 ? 'php' : 'hhvm';")
if [ "$runtime" = "hhvm" ]; then
hhvm /usr/local/bin/composer install
else
# Implicitly uses php
composer install
fi
hh_client
if [ "$canruntests" = "yes" ]; then
vendor/bin/hacktest tests/
fi