From ea09367e772ab51ec61195de836a679df9478de1 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Tue, 12 Aug 2014 16:40:21 -0400 Subject: [PATCH] Config files for various code quality services --- .scrutinizer.yml | 25 +++++++++++++++++++++++++ .travis.yml | 27 +++++++++++++++++++++++++++ phpci.yml | 10 +++++++--- tests/bootstrap.php | 4 ++-- tests/env/autoloader.php | 27 +++++++++++++-------------- tests/phinx/mysql.yml | 15 +++++++++++++++ tests/phinx/pgsql.yml | 15 +++++++++++++++ 7 files changed, 104 insertions(+), 19 deletions(-) create mode 100644 .scrutinizer.yml create mode 100644 .travis.yml create mode 100644 tests/phinx/mysql.yml create mode 100644 tests/phinx/pgsql.yml diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 0000000..c8221ee --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,25 @@ +imports: + - php + +tools: + external_code_coverage: + timeout: 1000 + # PHP + + # Don't like PSR standards, not going to get messages for them! + php_code_sniffer: false + + php_sim: true + # Can't be used with similarity analyzer + php_cpd: false + + php_mess_detector: true + php_pdepend: true + php_loc: true + php_analyzer: + config: + metrics_lack_of_cohesion_methods: + enabled: true + doc_comment_fixes: + enabled: true + php_hhvm: true \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1f13a58 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +language: php + +php: + - 5.5 + - 5.6 + - hhvm + +install: + - composer install + +env: + - DB=mysql + - DB=pgsql + +before_script: + - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS todo_test;' -U postgres; fi" + - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database todo_test;' -U postgres; fi" + - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS todo_test;'; fi"; + +script: + - vendor/bin/phinx migrate -e testing -c tests/phinx/$DB.yml + - mkdir -p build/logs + - cd tests && phpunit --coverage-clover build/logs/clover.xml + +after_script: + - wget https://scrutinizer-ci.com/ocular.phar + - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml \ No newline at end of file diff --git a/phpci.yml b/phpci.yml index 8365373..1808475 100755 --- a/phpci.yml +++ b/phpci.yml @@ -10,18 +10,22 @@ build_settings: - "migrations" setup: + composer: + action: "install" env: APPLICATION_ENV: "development" + shell: + - "cd %BUILD_PATH% && vendor/bin/phinx rollback -e testing -t0" + - "cd %BUILD_PATH% && vendor/bin/phinx migrate -e testing" test: php_unit: config: 'tests/phpunit.xml' run_from: 'tests' - coverage: '../web/coverage/' php_mess_detector: allowed_warnings: 10 rules: - "unusedcode" - "naming" - php_docblock_checker: - php_loc: +# php_docblock_checker: +# php_loc: diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 50e08f2..70116f0 100755 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,10 +1,10 @@