Skip to content

Commit

Permalink
Docker setup for running unit tests on PHP 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
serbanghita committed Oct 27, 2023
1 parent e8c95d6 commit 091c628
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/examples export-ignore
/docs export-ignore
/export export-ignore
/tests export-ignore
/.* export-ignore
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ nbproject/
/coverage
/phpunit.phar
composer.lock
composer.phar
.phpunit.result.cache
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
}
],
"require": {
"php": ">=5.0.0"
"php": "5.6.*"
},
"require-dev": {
"phpunit/phpunit": "~4.8.35||~5.7"
"phpunit/phpunit": "~4.8.36"
},
"autoload": {
"classmap": ["Mobile_Detect.php"],
Expand Down
31 changes: 15 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
app:
restart: 'on-failure'
image: php:7
working_dir: /app
command: vendor/bin/phpunit -v -c tests/phpunit.xml --coverage-text --strict-coverage --stop-on-risky
ports:
- "8000:8000"
volumes:
- .:/app

composer:
restart: 'no'
image: composer/composer:php7
command: install
volumes:
- .:/app
services:
app:
image: php:5.6-cli-alpine3.8
working_dir: /app
command: >
/bin/sh -c "
rm -rf vendor &&
rm -f composer.lock composer.phar &&
curl -s https://getcomposer.org/download/2.0.0/composer.phar -o composer.phar &&
php composer.phar update --no-interaction --prefer-dist -vvv &&
vendor/bin/phpunit -v -c tests/phpunit.xml --coverage-text --strict-coverage --stop-on-risky"
ports:
- "8000:8000"
volumes:
- .:/app

0 comments on commit 091c628

Please sign in to comment.