Files
cheeper-ddd-cqrs-example/Makefile
2020-06-03 12:15:29 +02:00

49 lines
1.3 KiB
Makefile
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Default shell to use
SHELL := bash
# Reuse the same shell instance within a target
.ONESHELL:
# Set bash to fail immediately (-e), to error on unset variables (-u) and to fail on piped commands (pipefail)
.SHELLFLAGS := -eu -o pipefail -c
# Delete any generated target on failure
.DELETE_ON_ERROR:
# Make flags
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
# Shortcut for docker-compose command
COMPOSE = docker-compose
# Shortcut for docker run on the app container with all dependencies already up
RUN_APP = $(COMPOSE) run --rm app -d memory_limit=-1
# Non file-generating targets
.PHONY: install-deps update-deps ci-analysis ci-tests
INFECTION_VERSION=0.16.3
# Default target when run with just 'make'
default: ci-tests
# Main docker image build
build:
@$(COMPOSE) build --parallel
$(COMPOSE) up --no-start --remove-orphans
install-deps: build
$(RUN_APP) /usr/local/bin/composer install
ci-infection: install-deps
wget https://github.com/infection/infection/releases/download/$(INFECTION_VERSION)/infection.phar
php infection.phar --min-msi=80 --min-covered-msi=70 --threads=4 --show-mutations --only-covered
rm -rf infection.phar
ci-analysis: install-deps
$(RUN_APP) /usr/local/bin/composer psalm
ci-tests: install-deps
$(RUN_APP) /usr/local/bin/composer unit-tests