From 8c823e525f936d472b2d72d4bdf8e00678615d19 Mon Sep 17 00:00:00 2001 From: Yuichi Ishikawa Date: Sat, 18 Apr 2020 10:17:22 +0900 Subject: [PATCH] fix travis --- .travis.yml | 8 +++++++- tests/travis/install-script.sh | 8 ++++++++ tests/travis/php7.2.ini | 2 ++ tests/travis/php7.3.ini | 3 +++ tests/travis/php7.4.ini | 3 +++ tests/travis/run-test.sh | 8 ++++++++ 6 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tests/travis/install-script.sh create mode 100644 tests/travis/php7.2.ini create mode 100644 tests/travis/php7.3.ini create mode 100644 tests/travis/php7.4.ini create mode 100644 tests/travis/run-test.sh diff --git a/.travis.yml b/.travis.yml index ac07cb5..82d31b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,5 +5,11 @@ php: - '7.3' - '7.4' +before_install: + - phpenv config-add tests/travis/php$TRAVIS_PHP_VERSION.ini + +install: + - export TRAVIS_PHP_VERSION; sh tests/travis/install-script.sh + script: - - vendor/bin/phpunit -c tests + - TRAVIS_SKIP_TEST=1; export TRAVIS_SKIP_TEST; sh tests/travis/run-test.sh diff --git a/tests/travis/install-script.sh b/tests/travis/install-script.sh new file mode 100644 index 0000000..de8cea6 --- /dev/null +++ b/tests/travis/install-script.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +composer install + +#case "$TRAVIS_PHP_VERSION" in +# 5\.6) composer require --dev "phpunit/phpunit 5.*" ;; +# 7\.*) composer require --dev "phpunit/phpunit 6.*" ;; +#esac diff --git a/tests/travis/php7.2.ini b/tests/travis/php7.2.ini new file mode 100644 index 0000000..1aba15a --- /dev/null +++ b/tests/travis/php7.2.ini @@ -0,0 +1,2 @@ +extension = apcu.so +apc.enable_cli = 1 diff --git a/tests/travis/php7.3.ini b/tests/travis/php7.3.ini new file mode 100644 index 0000000..077e590 --- /dev/null +++ b/tests/travis/php7.3.ini @@ -0,0 +1,3 @@ +extension = apcu.so +extension = mongodb.so +apc.enable_cli = 1 diff --git a/tests/travis/php7.4.ini b/tests/travis/php7.4.ini new file mode 100644 index 0000000..077e590 --- /dev/null +++ b/tests/travis/php7.4.ini @@ -0,0 +1,3 @@ +extension = apcu.so +extension = mongodb.so +apc.enable_cli = 1 diff --git a/tests/travis/run-test.sh b/tests/travis/run-test.sh new file mode 100644 index 0000000..067359f --- /dev/null +++ b/tests/travis/run-test.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ -e vendor/bin/phpunit ]; then + PHPUNITDIR="vendor/bin/" +else + PHPUNITDIR="" +fi +${PHPUNITDIR}phpunit -c tests