If you use ant to organize your build, you might not even need a two-tier build, but you can use the Jenkins / Ant command to stop your tests from failing, as you are usually uninterested in when breaking a build.
I usually use:
<target name="phpunit" description="Run unit tests with PHPUnit"> <exec executable="phpunit" failonerror="true"/> </target>
as for the first purposes of assembly. It will try to generate code coverage, so running phpunit will take less time, but you don’t have to spend time creating all the metrics.
If you want this to be very fast:
You can tell Jenkins that you have a “post-build action” that starts a new build when your run tests build completed successfully. You can even set it up to wait half an hour or so to start building the Metric just in case you are doing 3-4 commits and don't want the metric build to start right after the first one worked
source share