Skip to content

Rethink TravisCI configuration #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 46 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,56 @@
dist: xenial
lang: php
compiler:
- gcc
cache:
directories:
- /home/travis/.phpenv/
env:
global:
- MEMPROF_CFLAGS='-Wall -Werror'
# TravisCI configuration for arnaud-lb/php-memory-profiler

if: "branch = v2"

language: "php"
os:
- "linux"
dist: "bionic"

addons:
apt:
packages:
- "libjudy-dev"
- "libonig-dev"
- "libzip-dev"

php:
- "8.0"
- "7.4"
- "7.3"
- "7.2"
- "7.1"

jobs:
allow_failures:
- env: PHP_VERSION=8.0snapshot
fast_finish: true
include:
- env: PHP_VERSION=8.0snapshot
- env: PHP_VERSION=7.4.12
- env: PHP_VERSION=7.3.24
- env: PHP_VERSION=7.2.19
- env: PHP_VERSION=7.1.33

cache:
directories:
- "${HOME}/.phpenv/"

before_install:
- |
# Use a non-zts PHP build
set -e
sudo apt-get install libjudy-dev libonig-dev libzip-dev
if ! [ -f $HOME/.phpenv/memprof-travis-cached ]; then
echo "Building PHP"
git clone git://github.com/php-build/php-build.git $HOME/.phpenv/plugins/php-build
phpenv install --verbose --force $PHP_VERSION
rm -rf $HOME/.phpenv/plugins/php-build
touch $HOME/.phpenv/memprof-travis-cached
else
echo "PHP already built"
# Using PHP non-ZTS
PHP_VERSION="$(php -r 'echo PHP_VERSION;')"
if ! [ -f "${HOME}/.phpenv/php-non-zts-built" ]; then
echo "Building PHP ZTS ${PHP_VERSION} ..."
git clone git://github.com/php-build/php-build.git "${HOME}/.phpenv/plugins/php-build"
phpenv install --verbose --force "${PHP_VERSION}"
rm -rf "${HOME}/.phpenv/plugins/php-build"
touch "${HOME}/.phpenv/php-non-zts-built"
fi
phpenv rehash
phpenv global $PHP_VERSION
phpenv global "${PHP_VERSION}"
phpenv config-rm xdebug.ini
php -v

install:
- .travis/build.sh
- "phpize"
- "CFLAGS=\"-Wall -Werror\" ./configure"
- "make"
- "echo \"extension = $(realpath modules/memprof.so)\" >modules/memprof.ini"
- "phpenv config-add modules/memprof.ini"

script:
- .travis/test.sh
- "php --ri memprof"
- "REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=\"$(realpath \"$(which php)\")\" php run-tests.php -s -q --show-diff"
12 changes: 0 additions & 12 deletions .travis/build.sh

This file was deleted.

8 changes: 0 additions & 8 deletions .travis/test.sh

This file was deleted.