-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
67 lines (52 loc) · 2.32 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
DOCDIR := doc/api/
# Set some options on Github actions
ifeq ($(CI),true)
PSALM_XOPTIONS=--shepherd --no-progress --no-cache
endif
.PHONY: all stylecheck phpcompatcheck staticanalyses psalmanalysis doc tests verification
all: staticanalyses doc
verification: staticanalyses tests
staticanalyses: stylecheck phpcompatcheck psalmanalysis
stylecheck:
vendor/bin/phpcs --colors --standard=PSR12 src/ tests/
phpcompatcheck:
vendor/bin/phpcs --colors --standard=PHPCompatibility --runtime-set testVersion 7.1 src/ tests/
psalmanalysis: tests/Interop/AccountData.php
vendor/bin/psalm --threads=8 --no-cache --report=testreports/psalm.txt --report-show-info=true --no-diff $(PSALM_XOPTIONS)
tests: tests-interop unittests
vendor/bin/phpcov merge --html testreports/coverage testreports
.PHONY: unittests
unittests: tests/Unit/phpunit.xml
@echo
@echo ==========================================================
@echo " EXECUTING UNIT TESTS"
@echo ==========================================================
@echo
@mkdir -p testreports/unit
vendor/bin/phpunit -c tests/Unit/phpunit.xml
.PHONY: tests-interop
tests-interop: tests/Interop/phpunit.xml tests/Interop/AccountData.php
@echo
@echo ==========================================================
@echo " EXECUTING CARDDAV INTEROPERABILITY TESTS"
@echo ==========================================================
@echo
@mkdir -p testreports/interop
vendor/bin/phpunit -c tests/Interop/phpunit.xml
doc:
rm -rf $(DOCDIR)
phpDocumentor.phar -d src/ -t $(DOCDIR) --title="CardDAV Client Library" --setting=graphs.enabled=true --validate
[ -d ../carddavclient-pages ] && rsync -r --delete --exclude .git doc/api/ ../carddavclient-pages
# For github CI system - if AccountData.php is not available, create from AccountData.php.dist
tests/Interop/AccountData.php: | tests/Interop/AccountData.php.dist
cp $| $@
.PHONY: codecov-upload
codecov-upload:
if [ -n "$$CODECOV_TOKEN" ]; then \
curl -s https://codecov.io/bash >testreports/codecov.sh; \
bash testreports/codecov.sh -F unittests -f testreports/unit/clover.xml -n 'Carddavclient unit test coverage'; \
bash testreports/codecov.sh -F interop -f testreports/interop/clover.xml -n 'Carddavclient interoperability test coverage'; \
else \
echo "Error: Set CODECOV_TOKEN environment variable first"; \
exit 1; \
fi