diff --git a/.github/workflows/tests-mongodb.yml b/.github/workflows/tests-mongodb.yml index d8df373..fa44adf 100644 --- a/.github/workflows/tests-mongodb.yml +++ b/.github/workflows/tests-mongodb.yml @@ -18,6 +18,14 @@ jobs: - "7.3" - "7.4" include: + - php: "5.3" + phpunit: "4" + - php: "5.4" + phpunit: "4" + - php: "5.5" + phpunit: "4" + - php: "5.6" + phpunit: "4" - php: "7.0" phpunit: "6" @@ -39,14 +47,15 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: xdebug, xhprof, mongodb, tideways_xhprof + extensions: xdebug, xhprof, mongo, mongodb, tideways_xhprof - name: Validate composer.json and composer.lock run: composer validate - name: Install dependencies run: | - composer install --prefer-dist --no-progress + composer remove alcaeus/mongo-php-adapter --no-update --dev + composer install --prefer-dist composer require --dev phpunit/phpunit:^$PHPUNIT_VERSION - name: Install extensions diff --git a/install-extensions.sh b/install-extensions.sh index 9094699..951182e 100755 --- a/install-extensions.sh +++ b/install-extensions.sh @@ -17,14 +17,21 @@ has_extension() { } install_xhprof() { - local version="${1:-stable}" + local ext="xhprof" version="${1:-stable}" - has_extension "xhprof" && return 0 - pecl install xhprof-$version + has_extension "$ext" && return 0 + # https://github.com/shivammathur/setup-php/issues/905 + sudo rm -rf /tmp/pear # shivammathur's leftovers... + # Allow installing to /usr/local/php + sudo chown -R "$(id -un):" /usr/local/php/ + pecl install "$ext-$version" } install_mongo() { - echo no | pecl install mongo + local ext="mongo" version="${1:-stable}" + + has_extension "$ext" && return 0 + echo no | pecl install "$ext-$version" } install_mongodb() { @@ -58,13 +65,13 @@ install_tideways_xhprof() { has_extension "$extension" } -# Show php config paths -php --ini +pecl version +php -m case "$(uname -s):$PHP_VERSION" in *:5.*) install_xhprof 0.9.4 - install_mongo + install_mongo 1.6.16 ;; Linux:7.*|Linux:8.*) install_xhprof