From bbb8cb693a9b551fb00fcf4a2ae25dc9976ff23d Mon Sep 17 00:00:00 2001 From: Robert <36849548+nightio@users.noreply.github.com> Date: Fri, 19 Jul 2024 09:54:34 +0200 Subject: [PATCH] Improved docker compose for tests (#21) Co-authored-by: Robert --- .gitattributes | 4 +++- compose.yml | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index 52f04c8..ea6ed5e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compose.yml b/compose.yml index 88d557f..efb6174 100644 --- a/compose.yml +++ b/compose.yml @@ -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: