Skip to content

Commit ced7a54

Browse files
authored
Merge pull request #48 from szepeviktor/patch-1
Rethink TravisCI configuration
2 parents da54484 + c503d1f commit ced7a54

File tree

3 files changed

+46
-52
lines changed

3 files changed

+46
-52
lines changed

.travis.yml

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,56 @@
1-
dist: xenial
2-
lang: php
3-
compiler:
4-
- gcc
5-
cache:
6-
directories:
7-
- /home/travis/.phpenv/
8-
env:
9-
global:
10-
- MEMPROF_CFLAGS='-Wall -Werror'
1+
# TravisCI configuration for arnaud-lb/php-memory-profiler
2+
3+
if: "branch = v2"
4+
5+
language: "php"
6+
os:
7+
- "linux"
8+
dist: "bionic"
9+
10+
addons:
11+
apt:
12+
packages:
13+
- "libjudy-dev"
14+
- "libonig-dev"
15+
- "libzip-dev"
16+
17+
php:
18+
- "8.0"
19+
- "7.4"
20+
- "7.3"
21+
- "7.2"
22+
- "7.1"
23+
1124
jobs:
12-
allow_failures:
13-
- env: PHP_VERSION=8.0snapshot
1425
fast_finish: true
15-
include:
16-
- env: PHP_VERSION=8.0snapshot
17-
- env: PHP_VERSION=7.4.12
18-
- env: PHP_VERSION=7.3.24
19-
- env: PHP_VERSION=7.2.19
20-
- env: PHP_VERSION=7.1.33
26+
27+
cache:
28+
directories:
29+
- "${HOME}/.phpenv/"
2130

2231
before_install:
2332
- |
24-
# Use a non-zts PHP build
25-
set -e
26-
sudo apt-get install libjudy-dev libonig-dev libzip-dev
27-
if ! [ -f $HOME/.phpenv/memprof-travis-cached ]; then
28-
echo "Building PHP"
29-
git clone git://github.com/php-build/php-build.git $HOME/.phpenv/plugins/php-build
30-
phpenv install --verbose --force $PHP_VERSION
31-
rm -rf $HOME/.phpenv/plugins/php-build
32-
touch $HOME/.phpenv/memprof-travis-cached
33-
else
34-
echo "PHP already built"
33+
# Using PHP non-ZTS
34+
PHP_VERSION="$(php -r 'echo PHP_VERSION;')"
35+
if ! [ -f "${HOME}/.phpenv/php-non-zts-built" ]; then
36+
echo "Building PHP ZTS ${PHP_VERSION} ..."
37+
git clone git://github.com/php-build/php-build.git "${HOME}/.phpenv/plugins/php-build"
38+
phpenv install --verbose --force "${PHP_VERSION}"
39+
rm -rf "${HOME}/.phpenv/plugins/php-build"
40+
touch "${HOME}/.phpenv/php-non-zts-built"
3541
fi
3642
phpenv rehash
37-
phpenv global $PHP_VERSION
43+
phpenv global "${PHP_VERSION}"
44+
phpenv config-rm xdebug.ini
45+
php -v
3846
3947
install:
40-
- .travis/build.sh
48+
- "phpize"
49+
- "CFLAGS=\"-Wall -Werror\" ./configure"
50+
- "make"
51+
- "echo \"extension = $(realpath modules/memprof.so)\" >modules/memprof.ini"
52+
- "phpenv config-add modules/memprof.ini"
53+
4154
script:
42-
- .travis/test.sh
55+
- "php --ri memprof"
56+
- "REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=\"$(realpath \"$(which php)\")\" php run-tests.php -s -q --show-diff"

.travis/build.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

.travis/test.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)