Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ branches:

cache:
- composer
- $HOME/.composer/cache
- directories:
- $HOME/.composer/cache
- $HOME/opt/$TRAVIS_PHP_VERSION

env:
global:
Expand All @@ -35,7 +37,7 @@ matrix:

before_install:
- phpenv config-rm xdebug.ini
- if [[ $TRAVIS_PHP_VERSION = '5.6' ]]; then printf "\n" | pecl install imagick; fi
- ./bin/install-imagick.sh
- php -m

install:
Expand Down
40 changes: 40 additions & 0 deletions bin/install-imagick.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash

set -ex

# Install imagick for PHP 5.6, 7.0 and 7.1.
# Taken from http://stackoverflow.com/a/41138688/664741

# ImageMagick version to use for PHP 7.x
IMAGEMAGICK_VERSION='6.9.8-3'

install_imagemagick() {
cd /tmp

curl -O https://www.imagemagick.org/download/ImageMagick-$IMAGEMAGICK_VERSION.tar.gz
tar xzf ImageMagick-$IMAGEMAGICK_VERSION.tar.gz
cd ImageMagick-$IMAGEMAGICK_VERSION

./configure --prefix=$HOME/opt/$TRAVIS_PHP_VERSION
make
make install

cd $TRAVIS_BUILD_DIR
}

if [[ ${TRAVIS_PHP_VERSION:0:2} == '7.' ]]; then

PATH=$HOME/opt/$TRAVIS_PHP_VERSION/bin:$PATH convert -v | grep $IMAGEMAGICK_VERSION || install_imagemagick

ls $HOME/opt/$TRAVIS_PHP_VERSION

export LD_FLAGS=-L$HOME/opt/$TRAVIS_PHP_VERSION/lib
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:$HOME/opt/$TRAVIS_PHP_VERSION/lib
export CPATH=$CPATH:$HOME/opt/$TRAVIS_PHP_VERSION/include

echo $HOME/opt/$TRAVIS_PHP_VERSION | pecl install imagick

elif [[ $TRAVIS_PHP_VERSION == 5.6 ]]; then

echo | pecl install imagick
fi
19 changes: 16 additions & 3 deletions utils/behat-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,23 @@ function version_tags( $prefix, $current, $operator = '<' ) {
if ( ! $current )
return array();

exec( "grep '@{$prefix}-[0-9\.]*' -h -o features/*.feature | uniq", $existing_tags );

$skip_tags = array();

if ( 'require-wp' === $prefix ) {
if ( 'trunk' === $current ) {
// Exclude nothing.
return array();
}
// Exclude cutting-edge.
$skip_tags[] = '@require-wp-trunk';

if ( 'latest' === $current ) {
return $skip_tags;
}
}

exec( "grep '@{$prefix}-[0-9\.]*' -h -o features/*.feature | sort -u", $existing_tags );

foreach ( $existing_tags as $tag ) {
$compare = str_replace( "@{$prefix}-", '', $tag );
if ( version_compare( $current, $compare, $operator ) ) {
Expand All @@ -43,7 +56,7 @@ function version_tags( $prefix, $current, $operator = '<' ) {
# Require PHP extension, eg 'imagick'.
function extension_tags() {
$extension_tags = array();
exec( "grep '@require-extension-[A-Za-z_]*' -h -o features/*.feature | uniq", $extension_tags );
exec( "grep '@require-extension-[A-Za-z_]*' -h -o features/*.feature | sort -u", $extension_tags );

$skip_tags = array();

Expand Down