Difference between revisions of "Continuous Integration"

From OpenEMR Project Wiki
(Information)
(usage documentation)
Line 1: Line 1:
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.4 up to PHP v7.1. Make sure the service status is green and not red!
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!
 
Here's how to run the checks locally (these are for Linux/Mac environments):
 
== Linting Check (All) ==
 
<pre>
find . -type d \( -path ./vendor \
                  -o -path ./interface/main/calendar/modules \
                  -o -path ./interface/reports \
                  -o -path ./contrib/util \
                  -o -path ./library/html2pdf/vendor/tecnickcom \
                  -o -path ./library/classes/fpdf \
                  -o -path ./library/html2pdf \
                  -o -path ./gacl \
                  -o -path ./library/edihistory \) -prune -o \
      -name "*.php" -print0 | xargs -0 -n1 -P8 php -l
</pre>
 
== Linting Check (One File) ==
 
<pre>
php -l services/PatientService.php
</pre>
 
== Styling Check (All) ==
 
<pre>
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
php phpcs.phar -pn --extensions=php,inc --standard=ci/phpcs.xml --report=summary .
</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.xml --report=summary services/PatientService.php
</pre>
 
(Make sure you don't check in the phpcs.phar)

Revision as of 19:06, 15 July 2017

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!

Here's how to run the checks locally (these are for Linux/Mac environments):

Linting Check (All)

find . -type d \( -path ./vendor \
                  -o -path ./interface/main/calendar/modules \
                  -o -path ./interface/reports \
                  -o -path ./contrib/util \
                  -o -path ./library/html2pdf/vendor/tecnickcom \
                  -o -path ./library/classes/fpdf \
                  -o -path ./library/html2pdf \
                  -o -path ./gacl \
                  -o -path ./library/edihistory \) -prune -o \
       -name "*.php" -print0 | xargs -0 -n1 -P8 php -l

Linting Check (One File)

php -l services/PatientService.php

Styling Check (All)

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

Styling Check (One File)

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

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