Skip to content

Commit d9cde8c

Browse files
authored
Merge pull request #89 from glensc/test-supported-versions-5.x
CI: Add php 5.x to test matrix
2 parents 897cbee + 6f5ecc9 commit d9cde8c

2 files changed

Lines changed: 25 additions & 9 deletions

File tree

.github/workflows/tests-mongodb.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ jobs:
1818
- "7.3"
1919
- "7.4"
2020
include:
21+
- php: "5.3"
22+
phpunit: "4"
23+
- php: "5.4"
24+
phpunit: "4"
25+
- php: "5.5"
26+
phpunit: "4"
27+
- php: "5.6"
28+
phpunit: "4"
2129
- php: "7.0"
2230
phpunit: "6"
2331

@@ -39,14 +47,15 @@ jobs:
3947
uses: shivammathur/setup-php@v2
4048
with:
4149
php-version: ${{ matrix.php }}
42-
extensions: xdebug, xhprof, mongodb, tideways_xhprof
50+
extensions: xdebug, xhprof, mongo, mongodb, tideways_xhprof
4351

4452
- name: Validate composer.json and composer.lock
4553
run: composer validate
4654

4755
- name: Install dependencies
4856
run: |
49-
composer install --prefer-dist --no-progress
57+
composer remove alcaeus/mongo-php-adapter --no-update --dev
58+
composer install --prefer-dist
5059
composer require --dev phpunit/phpunit:^$PHPUNIT_VERSION
5160
5261
- name: Install extensions

install-extensions.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,21 @@ has_extension() {
1717
}
1818

1919
install_xhprof() {
20-
local version="${1:-stable}"
20+
local ext="xhprof" version="${1:-stable}"
2121

22-
has_extension "xhprof" && return 0
23-
pecl install xhprof-$version
22+
has_extension "$ext" && return 0
23+
# https://github.com/shivammathur/setup-php/issues/905
24+
sudo rm -rf /tmp/pear # shivammathur's leftovers...
25+
# Allow installing to /usr/local/php
26+
sudo chown -R "$(id -un):" /usr/local/php/
27+
pecl install "$ext-$version"
2428
}
2529

2630
install_mongo() {
27-
echo no | pecl install mongo
31+
local ext="mongo" version="${1:-stable}"
32+
33+
has_extension "$ext" && return 0
34+
echo no | pecl install "$ext-$version"
2835
}
2936

3037
install_mongodb() {
@@ -58,13 +65,13 @@ install_tideways_xhprof() {
5865
has_extension "$extension"
5966
}
6067

61-
# Show php config paths
62-
php --ini
68+
pecl version
69+
php -m
6370

6471
case "$(uname -s):$PHP_VERSION" in
6572
*:5.*)
6673
install_xhprof 0.9.4
67-
install_mongo
74+
install_mongo 1.6.16
6875
;;
6976
Linux:7.*|Linux:8.*)
7077
install_xhprof

0 commit comments

Comments
 (0)