-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.base.xml
More file actions
138 lines (116 loc) · 4.58 KB
/
Copy pathbuild.base.xml
File metadata and controls
138 lines (116 loc) · 4.58 KB
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
130
131
132
133
134
135
136
137
138
<?xml version="1.0" encoding="UTF-8"?>
<project name="randock" default="validate">
<!-- service name used for docker commands -->
<property name="docker-compose" value="docker-compose"/>
<property name="docker.service_name" value="fpm" />
<property name="phpqa.config_dir" value="vendor/randock/build" />
<!-- symfony methods -->
<import file="./build.symfony.xml" />
<!-- xdebug methods -->
<import file="./build.xdebug.xml" />
<!-- PHP-cs-fixer methods -->
<import file="./build.php-cs-fixer.xml" />
<!-- PHP unit methods -->
<import file="./build.phpunit.xml" />
<!-- behat methods -->
<import file="./build.behat.xml" />
<!-- Linting methods -->
<import file="./build.lint.xml" />
<!-- Static analysis methods -->
<import file="./build.static-analysis.xml" />
<!-- Alias for php-cs-fixer at the moment, might fix more stuff in the future -->
<target name="fix" depends="php-cs-fixer" />
<target name="ci-setup">
<exec executable="${docker-compose}" failonerror="true">
<arg value = "exec" />
<arg value = "-T" />
<arg value = "${docker.service_name}" />
<arg value = "ant" />
<arg value = "ci-prepare" />
</exec>
</target>
<target name="ci-run">
<exec executable="${docker-compose}" failonerror="true">
<arg value = "exec" />
<arg value = "-T" />
<arg value = "${docker.service_name}" />
<arg value = "ant" />
<arg value = "ci" />
</exec>
</target>
<!-- this is the main entry point run within the containers -->
<target name="ci-prepare"
depends="prepare,phpunit-prepare,symfony-prepare" />
<!-- The CI job is executed by the CI server, to verify, validate and
generate QA reports. -->
<target name="ci"
depends="lint,static-analysis,php-cs-fixer-ci,phpunit-ci,symfony-change-owner,behat-ci,-check-failure"
description="Performs static analysis, runs the tests, and generates project documentation" />
<!-- The validate job is the default job, executed by the developers
before pushing (can be configured in the pre push hook) -->
<target name="validate"
depends="prepare,lint,php-cs-fixer-ci,phpunit,behat,-check-failure"
description="Performs a lint check and runs the tests"/>
<target name="pre-push"
depends="prepare,lint,php-cs-fixer-ci,phpunit,-check-failure"
description="Basic checks for pre push hook"/>
<!-- Method to check result of above commands -->
<target name="-check-failure">
<fail message="PHPQA errors">
<condition>
<and>
<isset property="result.phpqa" />
<not>
<equals arg1="${result.phpqa}" arg2="0"/>
</not>
</and>
</condition>
</fail>
<fail message="Unit test errors">
<condition>
<and>
<isset property="result.phpunit" />
<not>
<equals arg1="${result.phpunit}" arg2="0"/>
</not>
</and>
</condition>
</fail>
<fail message="Behat errors">
<condition>
<and>
<isset property="result.behat" />
<not>
<equals arg1="${result.behat}" arg2="0"/>
</not>
</and>
</condition>
</fail>
<fail message="Code style errors, run php-cs-fixer">
<condition>
<and>
<isset property="result.php-cs-fixer"/>
<not>
<equals arg1="${result.php-cs-fixer}" arg2="0"/>
</not>
</and>
</condition>
</fail>
</target>
<!-- Internally used to cleanup previous builds -->
<target name="clean"
unless="clean.done"
description="Cleanup build artifacts">
<delete dir="${basedir}/build/coverage"/>
<property name="clean.done" value="true"/>
</target>
<!-- Internally used to prepare new builds -->
<target name="prepare"
unless="prepare.done"
depends="clean"
description="Prepare for build">
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/behat"/>
<property name="prepare.done" value="true"/>
</target>
</project>