-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (37 loc) · 1.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
ifeq ($(OS),Windows_NT)
PWD := $(shell cd)
else
PWD := $(shell pwd -L)
endif
ARCH := $(shell uname -m)
PLATFORM :=
ifeq ($(ARCH),arm64)
PLATFORM := --platform=linux/amd64
endif
PHP_IMAGE = gustavofreze/php:8.3
DOCKER_RUN = docker run ${PLATFORM} -u root --rm -it --network=tiny-blocks --name test-lib \
-v ${PWD}:/app \
-v ${PWD}/tests/Integration/Database/Migrations:/test-adm-migrations \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /app ${PHP_IMAGE}
.PHONY: configure test unit-test test-no-coverage configure-test-environment review show-reports clean
configure: configure-test-environment
@${DOCKER_RUN} composer update --optimize-autoloader
test: configure-test-environment
@${DOCKER_RUN} composer tests
unit-test:
@${DOCKER_RUN} composer run unit-test
test-no-coverage: configure-test-environment
@${DOCKER_RUN} composer tests-no-coverage
configure-test-environment:
@if ! docker network inspect tiny-blocks > /dev/null 2>&1; then \
docker network create tiny-blocks > /dev/null 2>&1; \
fi
@docker volume create test-adm-migrations > /dev/null 2>&1
review:
@${DOCKER_RUN} composer review
show-reports:
@sensible-browser report/coverage/coverage-html/index.html
clean:
@sudo chown -R ${USER}:${USER} ${PWD}
@rm -rf report vendor .phpunit.cache