Skip to content

Commit

Permalink
Ability to run tests in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
muxx committed Aug 10, 2023
1 parent 29d6732 commit fdc95df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,7 @@ build/*

# Test report & coverage
test-report.xml
.phpunit.result.cache
clover.xml
composer.lock
docker-compose.yml
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SRC_DIR=$(ROOT_DIR)/src
BIN_DIR=$(ROOT_DIR)/vendor/bin
ifneq (,$(shell (type docker-compose 2>&1 >/dev/null && echo 1) || true))
PHP=docker-compose run --rm --no-deps php php
else
PHP=php
endif

test:
@echo "==> Running tests"
@cd $(ROOT_DIR)
@cp .env.dist .env
@php -d memory_limit=-1 $(BIN_DIR)/phpunit -c phpunit.xml.dist
@$(PHP) -d memory_limit=-1 vendor/bin/phpunit -c phpunit.xml.dist
@echo "==> Testing complete"

stan:
@echo "==> Running analysis"
@php $(BIN_DIR)/phpstan analyse
@$(PHP) vendor/bin/phpstan analyse
@echo "==> Analysis complete"

0 comments on commit fdc95df

Please sign in to comment.