Skip to content

Commit

Permalink
Improved docker compose for tests (#21)
Browse files Browse the repository at this point in the history
Co-authored-by: Robert <robert.kopera@verestro.com>
  • Loading branch information
nightio and Robert committed Jul 19, 2024
1 parent 4e4db31 commit bbb8cb6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/tests export-ignore
/phpunit.xml export-ignore
/phpunit.xml.dist export-ignore
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.php export-ignore
/Dockerfile export-ignore
/compose.yml export-ignore

8 changes: 6 additions & 2 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ x-params:
environment:
XDEBUG_MODE: coverage
volumes:
- ./:/app
- ./src/:/app/src:ro
- ./tests/:/app/tests:ro
- ./composer.json/:/app/composer.json:ro
- ./phpunit.xml.dist/:/app/phpunit.xml.dist:ro
- /app/tests/Bundle/App/var # anonymous writable volume for cache/logs
command:
- sh
- -c
- 'rm -f composer.lock && rm -rf tests/Bundle/App/var/cache && composer install && vendor/bin/simple-phpunit --coverage-text'
- 'composer install && vendor/bin/simple-phpunit --coverage-text'

# To run test just exec e.g. 'docker compose run --rm php8.1'
services:
Expand Down

0 comments on commit bbb8cb6

Please sign in to comment.