diff options
author | n-peugnet <n.peugnet@free.fr> | 2020-04-17 18:26:12 +0200 |
---|---|---|
committer | Vincent Peugnet <33429034+vincent-peugnet@users.noreply.github.com> | 2020-04-17 19:03:34 +0200 |
commit | 8b3eff62eeeac68b7ffa3add6db88df1d5e82371 (patch) | |
tree | 317c8f9d2688a238e50975ecfb3a50da69a159f6 /Makefile | |
parent | 477f4bb4d104905e6c846c3cec2ec57edd4de677 (diff) | |
download | wcms-8b3eff62eeeac68b7ffa3add6db88df1d5e82371.tar.gz wcms-8b3eff62eeeac68b7ffa3add6db88df1d5e82371.zip |
tests(phpcs): add cache file + checkstyle report
nox that the target are separated, you can use `make check -k` to keep
going even if one of the checks fail.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -19,6 +19,9 @@ js_sources := $(wildcard $(js_src_dir)/*.js) js_bundles := $(js_sources:$(js_src_dir)/%.js=assets/js/%.bundle.js) js_srcmaps := $(js_sources:$(js_src_dir)/%.js=assets/js/%.bundle.js.map) zip_release := dist/w_cms_$(GIT_VERSION).zip +phpcs_dir := $(build_dir)/phpcs +phpunit_dir := $(build_dir)/phpunit +dirs := $(phpcs_dir) $(phpunit_dir) # Default target. This executes everything targets needed to get a fully # working development environment. @@ -155,17 +158,27 @@ buildclean: # Run all checks. .PHONY: check -check: $(PREV_ENV_FILE) vendor - @echo Running checks... - phpcs +check: vendor lint test + +# Lint php code with phpcs. +.PHONY: lint +lint: $(phpcs_dir) + phpcs --report-full --report-checkstyle=$(phpcs_dir)/checkstyle.xml + +# Test php code with phpunit. +.PHONY: test +test: $(phpunit_dir) phpunit +# Create dirs if the do not exist +$(dirs): + mkdir -p $@ + # Touch files affected by the build environment to force the execution # of the corresponding targets. .PHONY: touch touch: - touch $(js_sources) - touch composer.json + touch composer.json webpack.config.js # Special (fake) target to always run a target but have Make consider # this updated if it was actually rewritten (a .PHONY target is always |