mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2025-01-10 09:02:15 +00:00
test build php for osx in travis
This commit is contained in:
parent
2f152b4a34
commit
43ba6e99fc
25
.travis.yml
25
.travis.yml
@ -1,13 +1,26 @@
|
|||||||
language: php
|
language: php
|
||||||
|
|
||||||
os:
|
matrix:
|
||||||
- linux
|
fast_finish: true
|
||||||
|
|
||||||
php:
|
include:
|
||||||
- 7.0
|
- os: linux
|
||||||
|
php: '7.0'
|
||||||
|
|
||||||
before_script:
|
- os: osx
|
||||||
- composer install --ignore-platform-reqs
|
osx_image: xcode7.3
|
||||||
|
language: generic
|
||||||
|
env:
|
||||||
|
- _OSX=10.11
|
||||||
|
- _PHP: php70
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then /usr/bin/env bash build/prepare_osx_env.sh ; fi
|
||||||
|
|
||||||
|
install:
|
||||||
|
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then /usr/bin/env bash tools/handle_brew_pkg.sh "${_PHP}" ; fi
|
||||||
|
- curl -s http://getcomposer.org/installer | php
|
||||||
|
- php composer.phar install --dev --no-interaction --ignore-platform-reqs
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- bin/phpunit
|
- bin/phpunit
|
||||||
|
31
tools/handle_brew_pkg.sh
Normal file
31
tools/handle_brew_pkg.sh
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ "$#" -eq 1 ]]; then
|
||||||
|
echo "Handling \"$1\" brew package..."
|
||||||
|
else
|
||||||
|
echo "Brew failed - invalid $0 call"
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $(brew ls --versions "$1") ]]; then
|
||||||
|
if brew outdated "$1"; then
|
||||||
|
echo "Package upgrade is not required, skipping"
|
||||||
|
else
|
||||||
|
echo "Updating package...";
|
||||||
|
brew upgrade "$1"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Upgrade failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Package not available - installing..."
|
||||||
|
brew install "$1"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Install failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Linking installed package..."
|
||||||
|
brew link "$1"
|
19
tools/prepare_osx_env.sh
Normal file
19
tools/prepare_osx_env.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
echo "Here's the OSX environment:"
|
||||||
|
sw_vers
|
||||||
|
brew --version
|
||||||
|
|
||||||
|
echo "Updating brew..."
|
||||||
|
brew update
|
||||||
|
|
||||||
|
if [[ "${_PHP}" == "hhvm" ]]; then
|
||||||
|
echo "Adding brew HHVM dependencies..."
|
||||||
|
brew tap hhvm/hhvm
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "Adding brew PHP dependencies..."
|
||||||
|
brew tap homebrew/dupes
|
||||||
|
brew tap homebrew/versions
|
||||||
|
brew tap homebrew/homebrew-php
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user