-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
129 lines (129 loc) · 5.41 KB
/
build.xml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?xml version="1.0" encoding="utf-8"?>
<project name="Heroes of Abenenez" basedir="." default="test">
<target name="test" depends="lint,cs,phpstan,sanity-checks,tests,clean-db"/>
<target name="test-coverage" depends="lint,cs,phpstan,sanity-checks,tests-coverage,clean-db"/>
<target name="test-ci" depends="install-ci,test"/>
<target name="test-ci-coverage" depends="install-ci,test-coverage"/>
<target name="test-phpdbg" depends="lint,cs,phpstan,sanity-checks,tests-phpdbg,clean-db"/>
<target name="release">
<input propertyName="version" message="Enter new version number" promptChar=":"/>
<replaceregexp file="CHANGELOG.md" pattern='Version ([0-9]+\.)+[0-9]+(\+|-)dev' replace='Version ${version}'/>
<echo message="Written new version number to CHANGELOG."/>
<exec executable="git" logoutput="true" passthru="true" checkreturn="true">
<arg line="add CHANGELOG.md"/>
</exec>
<exec executable="git" logoutput="true" passthru="true" checkreturn="true">
<arg line="commit --message='Version ${version}'"/>
</exec>
<echo message="Created release commit."/>
<exec executable="git" logoutput="true" passthru="true" checkreturn="true">
<arg line="tag ${version} --message='Version ${version}' --sign"/>
</exec>
<echo message="Created tag."/>
</target>
<target name="install-ci">
<mkdir dir="tests/_temp"/>
<copy file="tests/ci.neon" tofile="tests/local.neon"/>
<exec executable="composer" logoutput="true" passthru="true" checkreturn="true">
<arg value="install"/>
<arg value="--prefer-dist"/>
<arg value="--no-progress"/>
<arg value="--no-interaction"/>
</exec>
</target>
<target name="setup-db">
<exec executable="php" logoutput="true" passthru="true" checkreturn="true">
<arg path="ci/setup_db.php"/>
</exec>
</target>
<target name="lint" description="Syntax checks" >
<exec executable="vendor/bin/parallel-lint" logoutput="true" passthru="true" checkreturn="true">
<arg line=". -e php,phpt --exclude vendor --exclude temp --exclude tests/_temp --colors"/>
</exec>
</target>
<target name="cs" description="Coding standards compliance">
<exec executable="vendor/bin/phpcs" logoutput="true" passthru="true" checkreturn="true">
<arg value="--extensions=php,phpt"/>
<arg value="."/>
<arg value="--standard=vendor/nexendrie/code-quality/ruleset.xml"/>
<arg value="--colors"/>
<arg value="-p"/>
</exec>
</target>
<target name="phpstan" description="PHPStan analyzes">
<exec executable="vendor/bin/phpstan" logoutput="true" passthru="true" checkreturn="true">
<arg value="analyze"/>
</exec>
</target>
<target name="sanity-checks" description="Sanity checks for data" depends="setup-db">
<exec executable="php" logoutput="true" passthru="true" checkreturn="true">
<arg path="ci/sanity_checks.php"/>
</exec>
</target>
<target name="tests" description="Unit tests" depends="setup-db">
<exec executable="vendor/bin/run-tests" logoutput="true" passthru="true" checkreturn="true">
<arg value="-p"/>
<arg value="php"/>
<arg path="tests"/>
<arg value="-s"/>
</exec>
</target>
<target name="tests-coverage" description="Unit tests with code coverage (XDebug)" depends="setup-db">
<exec executable="vendor/bin/run-tests" logoutput="true" passthru="true" checkreturn="true">
<arg value="-p"/>
<arg value="php"/>
<arg path="tests"/>
<arg value="--coverage"/>
<arg path="./coverage.html"/>
<arg value="--coverage-src"/>
<arg path="./app"/>
<arg value="-s"/>
</exec>
</target>
<target name="tests-phpdbg" description="Unit tests with code coverage (phpdbg)" depends="setup-db">
<exec executable="vendor/bin/run-tests" logoutput="true" passthru="true" checkreturn="true">
<arg value="-p"/>
<arg value="phpdbg"/>
<arg path="tests"/>
<arg value="--coverage"/>
<arg path="./coverage.html"/>
<arg value="--coverage-src"/>
<arg path="./app"/>
<arg value="-s"/>
</exec>
</target>
<target name="clean-db">
<exec executable="php" logoutput="true" passthru="true" checkreturn="true">
<arg path="ci/clean_db.php"/>
</exec>
</target>
<target name="scrutinizer">
<phingcall target="install-ci"/>
<exec executable="vendor/bin/phpcs" logoutput="true" passthru="true" checkreturn="true">
<arg value="--extensions=php,phpt"/>
<arg value="."/>
<arg value="--standard=vendor/nexendrie/code-quality/ruleset.xml"/>
<arg value="--report=checkstyle"/>
<arg value="--report-file=codesniffer.cs"/>
</exec>
<exec executable="php" logoutput="true" passthru="true" checkreturn="true">
<arg path="ci/scrutinizer_setup.php"/>
</exec>
<exec executable="mysql" logoutput="true" passthru="true" checkreturn="true">
<arg line="-uroot -e 'CREATE DATABASE heroesofabenez'"/>
</exec>
<exec executable="mysql_tzinfo_to_sql" logoutput="true" passthru="true" checkreturn="true">
<arg line="/usr/share/zoneinfo | mysql -u root mysql"/>
</exec>
<phingcall target="setup-db"/>
<exec executable="vendor/bin/run-tests" logoutput="true" passthru="true" checkreturn="true">
<arg value="-p"/>
<arg value="php"/>
<arg path="tests"/>
<arg value="--coverage"/>
<arg path="./coverage.xml"/>
<arg value="--coverage-src"/>
<arg path="./app"/>
</exec>
</target>
</project>