1
0
mirror of synced 2024-11-21 11:26:02 +03:00

Ability to run tests in docker

This commit is contained in:
Ilyas Salikhov 2023-08-10 18:32:07 +03:00
parent 29d6732404
commit b478dd6f25
2 changed files with 9 additions and 6 deletions

2
.gitignore vendored
View File

@ -194,5 +194,7 @@ build/*
# Test report & coverage
test-report.xml
.phpunit.result.cache
clover.xml
composer.lock
docker-compose.yml

View File

@ -1,15 +1,16 @@
ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SRC_DIR=$(ROOT_DIR)/src
BIN_DIR=$(ROOT_DIR)/vendor/bin
ifneq ("$(wildcard docker-compose.yml)","")
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"