Difference between revisions of "Continuous Integration"

From OpenEMR Project Wiki
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Humble beginnings:
When code is pushed your Github pull request, our [https://travis-ci.org/openemr/openemr Continuous Integration service] will check for programmer errors from PHP v5.6 up to PHP v7.1. Make sure the service status is green and not red!
*https://github.com/openemr/openemr/issues/489
 
*https://github.com/openemr/openemr/pull/492
== Running Locally ==
The following sections provide instruction for Linux/OSX/WSL users who may want to run the CI commands locally. Doing this will help you to make sure you'll pass CI checks before committing/pushing your code. For all of the following, replace <code><openemrRoot></code> with the root directory of the project on your machine.
=== Linting Check (All) ===
 
<pre>
CI_JOB=lint_syntax ci/ci.php -d <openemrRoot>
</pre>
 
=== Linting Check (One File) ===
 
<pre>
php -l <file>
</pre>
 
=== Styling Check (All) ===
<pre>
CI_JOB=lint_style ci/ci.php -d <openemrRoot>
</pre>
 
=== Styling Check (One File) ===
 
<pre>
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
php phpcs.phar -pn --extensions=php,inc --standard=ci/phpcs_strict.xml --report=summary <file>
</pre>
 
(Make sure you don't check in the phpcs.phar)

Latest revision as of 01:47, 19 December 2019

When code is pushed your Github pull request, our Continuous Integration service will check for programmer errors from PHP v5.6 up to PHP v7.1. Make sure the service status is green and not red!

Running Locally

The following sections provide instruction for Linux/OSX/WSL users who may want to run the CI commands locally. Doing this will help you to make sure you'll pass CI checks before committing/pushing your code. For all of the following, replace <openemrRoot> with the root directory of the project on your machine.

Linting Check (All)

CI_JOB=lint_syntax ci/ci.php -d <openemrRoot>

Linting Check (One File)

php -l <file>

Styling Check (All)

CI_JOB=lint_style ci/ci.php -d <openemrRoot>

Styling Check (One File)

curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
php phpcs.phar -pn --extensions=php,inc --standard=ci/phpcs_strict.xml --report=summary <file>

(Make sure you don't check in the phpcs.phar)