PHPCI is a free and open source continuous integration tool specifically designed for PHP. We've built it with simplicity in mind, so whilst it doesn't do *everything* Jenkins can do, it is a breeze to set up and use.
_**Please be aware that this is a brand new project, in an alpha state, so there will be bugs and missing features.**_
##What it does:
* Clones your repository from Github or Bitbucket (support for standard Git repositories coming soon.)
* Allows you to set up and tear down test databases.
* Installs your project's Composer dependencies.
* Runs through any combination of the following plugins:
* PHP Unit
* PHP Mess Detector
* PHP Copy/Paste Detector
* PHP Code Sniffer
* You can mark directories for the plugins to ignore.
* You can mark certain plugins as being allowed to fail (but still run.)
Obviously, make sure you change the /path/to/phpci to the directory in which you installed PHPCI, and update the PHP path if necessary.
##Adding support for PHPCI to your projects:
Similar to Travis CI, to support PHPCI in your project, you simply need to add a `phpci.yml` file to the root of your repository. The file should look something like this:
setup:
mysql:
- "DROP DATABASE IF EXISTS test;"
- "CREATE DATABASE test;"
- "GRANT ALL PRIVILEGES ON test.* TO test@'localhost' IDENTIFIED BY 'test';"
composer:
action: "install"
ignore:
- "vendor/"
- "tests/"
test:
php_unit:
directory: "tests/"
php_mess_detector:
allow_failures: true
php_code_sniffer:
standard: "PSR2"
php_cpd:
allow_failures: true
complete:
mysql:
- "DROP DATABASE IF EXISTS b8_test;"
As mentioned earlier, PHPCI is powered by plugins, there are several phases in which plugins can be run:
*`setup` - This phase is designed to initialise the build procedure.
*`test` - The tests that should be run during the build. Plugins run during this phase will contribute to the success or failure of the build.
*`complete` - Always called when the `test` phase completes, regardless of success or failure.
*`success` - Called upon success of the `test` phase.
*`failure` - Called upon the failure of the `test` phase.
The `ignore` section is merely an array of paths that should be ignored in all tests (where possible.)
##Contributing
Contributions from others would be very much appreciated! Simply fork the repository, and send us a pull request when you're ready.
##Questions?
Email us at hello@block8.co.uk and we'll do our best to help!