mirror of
https://github.com/Froxlor/Froxlor.git
synced 2024-09-21 02:17:34 +00:00
[CI] add composer to build.xml; run PHPCompatibility check; run only phpunit in travis
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
parent
17c6b11a1b
commit
e1987af34d
23
.travis.yml
23
.travis.yml
@ -30,8 +30,9 @@ addons:
|
|||||||
apt:
|
apt:
|
||||||
update: true
|
update: true
|
||||||
|
|
||||||
install:
|
# build.xml includes that
|
||||||
- composer install
|
#install:
|
||||||
|
# - composer install
|
||||||
|
|
||||||
service:
|
service:
|
||||||
- mysql
|
- mysql
|
||||||
@ -44,14 +45,16 @@ before_script:
|
|||||||
- mysql -u root -pfr0xl0r.TravisCI -e "GRANT ALL ON froxlor010.* TO 'froxlor010'@'localhost';"
|
- mysql -u root -pfr0xl0r.TravisCI -e "GRANT ALL ON froxlor010.* TO 'froxlor010'@'localhost';"
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ant full-build-parallel
|
# sufficient for travis
|
||||||
-Dpdepend=$(pwd)/vendor/bin/pdepend
|
- ant phpunit-no-coverage
|
||||||
-Dphpmd=$(pwd)/vendor/bin/phpmd
|
# - ant full-build-parallel
|
||||||
-Dphpcpd=$(pwd)/vendor/bin/phpcpd
|
# -Dpdepend=$(pwd)/vendor/bin/pdepend
|
||||||
-Dphpcs=$(pwd)/vendor/bin/phpcs
|
# -Dphpmd=$(pwd)/vendor/bin/phpmd
|
||||||
-Dphploc=$(pwd)/vendor/bin/phploc
|
# -Dphpcpd=$(pwd)/vendor/bin/phpcpd
|
||||||
-Dphpdox=$(pwd)/vendor/bin/phpdox
|
# -Dphpcs=$(pwd)/vendor/bin/phpcs
|
||||||
-Dphpunit=$(pwd)/vendor/bin/phpunit
|
# -Dphploc=$(pwd)/vendor/bin/phploc
|
||||||
|
# -Dphpdox=$(pwd)/vendor/bin/phpdox
|
||||||
|
# -Dphpunit=$(pwd)/vendor/bin/phpunit
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
irc: "irc.freenode.org#froxlor"
|
irc: "irc.freenode.org#froxlor"
|
||||||
|
67
build.xml
67
build.xml
@ -2,29 +2,29 @@
|
|||||||
|
|
||||||
<project name="froxlor" default="build">
|
<project name="froxlor" default="build">
|
||||||
|
|
||||||
<!-- By default, we assume all tools to be on the $PATH -->
|
<!-- Use this when the tools are managed by Composer in ${basedir}/vendor/bin -->
|
||||||
<property name="pdepend" value="pdepend" />
|
<property name="pdepend" value="${basedir}/vendor/bin/pdepend" />
|
||||||
<property name="phpcpd" value="phpcpd" />
|
<property name="phpcpd" value="${basedir}/vendor/bin/phpcpd" />
|
||||||
<property name="phpcs" value="phpcs" />
|
<property name="phpcs" value="${basedir}/vendor/bin/phpcs" />
|
||||||
<property name="phpdox" value="phpdox" />
|
<property name="phpdox" value="${basedir}/vendor/bin/phpdox" />
|
||||||
<property name="phploc" value="phploc" />
|
<property name="phploc" value="${basedir}/vendor/bin/phploc" />
|
||||||
<property name="phpmd" value="phpmd" />
|
<property name="phpmd" value="${basedir}/vendor/bin/phpmd" />
|
||||||
<property name="phpunit" value="phpunit6" />
|
<property name="phpunit" value="${basedir}/vendor/bin/phpunit" />
|
||||||
|
|
||||||
<target name="full-build"
|
<target name="full-build"
|
||||||
depends="prepare,static-analysis,phpunit,phpdox,-check-failure"
|
depends="prepare,composer,static-analysis,phpunit,phpdox,-check-failure"
|
||||||
description="Performs static analysis, runs the tests, and generates project documentation" />
|
description="Performs static analysis, runs the tests, and generates project documentation" />
|
||||||
|
|
||||||
<target name="full-build-parallel"
|
<target name="full-build-parallel"
|
||||||
depends="prepare,static-analysis-parallel,phpunit,phpdox,-check-failure"
|
depends="prepare,composer,static-analysis-parallel,phpunit,phpdox,-check-failure"
|
||||||
description="Performs static analysis (executing the tools in parallel), runs the tests, and generates project documentation" />
|
description="Performs static analysis (executing the tools in parallel), runs the tests, and generates project documentation" />
|
||||||
|
|
||||||
<target name="quick-build"
|
<target name="quick-build"
|
||||||
depends="prepare,lint,phpunit-no-coverage"
|
depends="prepare,composer,lint,phpunit-no-coverage"
|
||||||
description="Performs a lint check and runs the tests (without generating code coverage reports)" />
|
description="Performs a lint check and runs the tests (without generating code coverage reports)" />
|
||||||
|
|
||||||
<target name="static-analysis"
|
<target name="static-analysis"
|
||||||
depends="lint,phploc-ci,pdepend,phpmd-ci,phpcs-ci,phpcpd-ci"
|
depends="composer,lint,phploc-ci,pdepend,phpmd-ci,phpcs-ci,phpcompat-ci,phpcpd-ci"
|
||||||
description="Performs static analysis" />
|
description="Performs static analysis" />
|
||||||
|
|
||||||
<!-- Adjust the threadCount attribute's value to the number of CPUs -->
|
<!-- Adjust the threadCount attribute's value to the number of CPUs -->
|
||||||
@ -38,6 +38,7 @@
|
|||||||
<antcall target="lint" />
|
<antcall target="lint" />
|
||||||
<antcall target="phpcpd-ci" />
|
<antcall target="phpcpd-ci" />
|
||||||
<antcall target="phpcs-ci" />
|
<antcall target="phpcs-ci" />
|
||||||
|
<antcall target="phpcompat-ci" />
|
||||||
<antcall target="phploc-ci" />
|
<antcall target="phploc-ci" />
|
||||||
</parallel>
|
</parallel>
|
||||||
</target>
|
</target>
|
||||||
@ -59,9 +60,19 @@
|
|||||||
<mkdir dir="${basedir}/build/logs" />
|
<mkdir dir="${basedir}/build/logs" />
|
||||||
<mkdir dir="${basedir}/build/pdepend" />
|
<mkdir dir="${basedir}/build/pdepend" />
|
||||||
<mkdir dir="${basedir}/build/phpdox" />
|
<mkdir dir="${basedir}/build/phpdox" />
|
||||||
|
|
||||||
<property name="prepare.done" value="true" />
|
<property name="prepare.done" value="true" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="composer"
|
||||||
|
description="Installing composer dependencies" depends="prepare">
|
||||||
|
<exec executable="composer" failonerror="true">
|
||||||
|
<arg value="install" />
|
||||||
|
<arg value="--prefer-dist" />
|
||||||
|
<arg value="--no-progress" />
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="lint" unless="lint.done"
|
<target name="lint" unless="lint.done"
|
||||||
description="Perform syntax check of sourcecode files">
|
description="Perform syntax check of sourcecode files">
|
||||||
<apply executable="php" taskname="lint">
|
<apply executable="php" taskname="lint">
|
||||||
@ -161,7 +172,8 @@
|
|||||||
description="Find coding standard violations using PHP_CodeSniffer and log result in XML format. Intended for usage within a continuous integration environment.">
|
description="Find coding standard violations using PHP_CodeSniffer and log result in XML format. Intended for usage within a continuous integration environment.">
|
||||||
<exec executable="${phpcs}" output="/dev/null" taskname="phpcs">
|
<exec executable="${phpcs}" output="/dev/null" taskname="phpcs">
|
||||||
<arg value="--report=checkstyle" />
|
<arg value="--report=checkstyle" />
|
||||||
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
|
<arg
|
||||||
|
value="--report-file=${basedir}/build/logs/checkstyle-standard.xml" />
|
||||||
<arg value="--standard=${basedir}/phpcs.xml" />
|
<arg value="--standard=${basedir}/phpcs.xml" />
|
||||||
<arg value="--extensions=php" />
|
<arg value="--extensions=php" />
|
||||||
<arg path="${basedir}/lib/Froxlor" />
|
<arg path="${basedir}/lib/Froxlor" />
|
||||||
@ -171,6 +183,29 @@
|
|||||||
<property name="phpcs.done" value="true" />
|
<property name="phpcs.done" value="true" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="phpcompat" unless="phpcompat.done"
|
||||||
|
depends="composer"
|
||||||
|
description="Find php violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
|
||||||
|
<exec executable="${phpcs}" taskname="phpcompat">
|
||||||
|
<arg
|
||||||
|
line="--standard=PHPCompatibility --runtime-set testVersion 5.6 ${basedir}/lib/Froxlor ${basedir}/tests" />
|
||||||
|
</exec>
|
||||||
|
|
||||||
|
<property name="phpcompat.done" value="true" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="phpcompat-ci" unless="phpcompat.done"
|
||||||
|
depends="composer"
|
||||||
|
description="Find php violations using PHP_CodeSniffer and log result in XML format. Intended for usage within a continuous integration environment.">
|
||||||
|
<exec executable="${phpcs}" output="/dev/null"
|
||||||
|
taskname="phpcompat">
|
||||||
|
<arg
|
||||||
|
line="--standard=PHPCompatibility --runtime-set testVersion 5.6 --report=checkstyle --report-file=${basedir}/build/logs/checkstyle-compat.xml ${basedir}/lib/Froxlor ${basedir}/tests" />
|
||||||
|
</exec>
|
||||||
|
|
||||||
|
<property name="phpcompat.done" value="true" />
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="phpcpd" unless="phpcpd.done"
|
<target name="phpcpd" unless="phpcpd.done"
|
||||||
description="Find duplicate code using PHPCPD and print human readable output. Intended for usage on the command line before committing.">
|
description="Find duplicate code using PHPCPD and print human readable output. Intended for usage on the command line before committing.">
|
||||||
<exec executable="${phpcpd}" taskname="phpcpd">
|
<exec executable="${phpcpd}" taskname="phpcpd">
|
||||||
@ -191,7 +226,7 @@
|
|||||||
<property name="phpcpd.done" value="true" />
|
<property name="phpcpd.done" value="true" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="phpunit" unless="phpunit.done" depends="prepare"
|
<target name="phpunit" unless="phpunit.done" depends="composer"
|
||||||
description="Run unit tests with PHPUnit">
|
description="Run unit tests with PHPUnit">
|
||||||
<exec executable="${phpunit}" resultproperty="result.phpunit"
|
<exec executable="${phpunit}" resultproperty="result.phpunit"
|
||||||
taskname="phpunit">
|
taskname="phpunit">
|
||||||
@ -205,7 +240,7 @@
|
|||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="phpunit-no-coverage" unless="phpunit.done"
|
<target name="phpunit-no-coverage" unless="phpunit.done"
|
||||||
depends="prepare"
|
depends="composer"
|
||||||
description="Run unit tests with PHPUnit (without generating code coverage reports)">
|
description="Run unit tests with PHPUnit (without generating code coverage reports)">
|
||||||
<exec executable="${phpunit}" failonerror="true"
|
<exec executable="${phpunit}" failonerror="true"
|
||||||
taskname="phpunit">
|
taskname="phpunit">
|
||||||
@ -220,7 +255,7 @@
|
|||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="phpdox" unless="phpdox.done"
|
<target name="phpdox" unless="phpdox.done"
|
||||||
depends="phploc-ci,phpcs-ci,phpmd-ci"
|
depends="phploc-ci,phpcs-ci,phpcompat-ci,phpmd-ci"
|
||||||
description="Generate project documentation using phpDox">
|
description="Generate project documentation using phpDox">
|
||||||
<exec executable="${phpdox}" dir="${basedir}/build"
|
<exec executable="${phpdox}" dir="${basedir}/build"
|
||||||
taskname="phpdox">
|
taskname="phpdox">
|
||||||
|
@ -71,5 +71,9 @@
|
|||||||
"lib/Froxlor"
|
"lib/Froxlor"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"post-install-cmd": "if [ -f ./vendor/bin/phpcs ]; then \"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility ; fi",
|
||||||
|
"post-update-cmd" : "if [ -f ./vendor/bin/phpcs ]; then \"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility ; fi"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,9 +14,14 @@
|
|||||||
|
|
||||||
<!-- PHP Code Sniffer findings -->
|
<!-- PHP Code Sniffer findings -->
|
||||||
<source type="phpcs">
|
<source type="phpcs">
|
||||||
<file name="logs/checkstyle.xml" />
|
<file name="logs/checkstyle-standard.xml" />
|
||||||
</source>
|
</source>
|
||||||
|
|
||||||
|
<!-- PHP Code Sniffer PHPCompatibility -->
|
||||||
|
<source type="phpcs">
|
||||||
|
<file name="logs/checkstyle-compat.xml" />
|
||||||
|
</source>
|
||||||
|
|
||||||
<!-- PHPMessDetector -->
|
<!-- PHPMessDetector -->
|
||||||
<source type="pmd">
|
<source type="pmd">
|
||||||
<file name="logs/pmd.xml" />
|
<file name="logs/pmd.xml" />
|
||||||
|
Loading…
Reference in New Issue
Block a user