From dcc136081dd08c0e69a2cc0601546878d620f1e9 Mon Sep 17 00:00:00 2001 From: Yuriy Pikhtarev Date: Wed, 1 Feb 2017 23:45:28 +0300 Subject: [PATCH 1/2] Codacy / Scrutinizer code coverage data, Slack hook to Travis CI --- .scrutinizer.yml | 3 +++ .travis.yml | 19 ++++++++++++++++++- composer.json | 6 ++++-- internal_data/report/.keep | 0 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 internal_data/report/.keep diff --git a/.scrutinizer.yml b/.scrutinizer.yml index f82540284..06ff5e422 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -30,3 +30,6 @@ coding_style: spaces: around_operators: concatenation: true + +tools: + external_code_coverage: true diff --git a/.travis.yml b/.travis.yml index 40b7b55b1..3c74aa463 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,16 +5,33 @@ php: - 7.1 - hhvm +addons: + hosts: + - tp.dev + - xn--o1af.xn--b1add + +env: + matrix: + - COMPOSER_FLAGS="--prefer-lowest" + - COMPOSER_FLAGS="" + matrix: allow_failures: - php: hhvm +notifications: + slack: torrentpier:ogxFfuvXqBpthIAq4ubyBDxu + before_script: - travis_retry composer self-update - - travis_retry composer install --no-interaction + - travis_retry composer install --no-interaction --prefer-dist script: - vendor/bin/phpunit --configuration phpunit.xml --coverage-clover=coverage.xml +after_script: + - php vendor/bin/codacycoverage clover coverage.xml + - php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.xml + after_success: - bash <(curl -s https://codecov.io/bash) diff --git a/composer.json b/composer.json index 8d7204d1d..8e0570c14 100644 --- a/composer.json +++ b/composer.json @@ -65,9 +65,11 @@ "doctrine/cache": "^1.6" }, "require-dev": { + "codacy/coverage": "dev-master", "phpunit/phpunit": "^5.0", - "squizlabs/php_codesniffer": "2.7.*", - "sebastian/phpcpd": "2.0.*" + "sebastian/phpcpd": "2.0.*", + "scrutinizer/ocular": "^1.3", + "squizlabs/php_codesniffer": "2.7.*" }, "autoload": { "psr-4": { diff --git a/internal_data/report/.keep b/internal_data/report/.keep new file mode 100644 index 000000000..e69de29bb From b3ad2846d5c56fc96d78c7b8526eb8f34509038b Mon Sep 17 00:00:00 2001 From: Yuriy Pikhtarev Date: Thu, 2 Feb 2017 02:14:46 +0300 Subject: [PATCH 2/2] Code Climate and Coveralls integrations added too --- .codeclimate.yml | 24 ++++++++++++++++++++++++ .coveralls.yml | 3 +++ .travis.yml | 29 ++++++++++++++++++++--------- composer.json | 2 ++ 4 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 .codeclimate.yml create mode 100644 .coveralls.yml diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 000000000..415e6f6fa --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,24 @@ +engines: + csslint: + enabled: true + duplication: + enabled: true + config: + languages: + - javascript + - php + eslint: + enabled: true + fixme: + enabled: true + phpmd: + enabled: true +ratings: + paths: + - "**.css" + - "**.inc" + - "**.js" + - "**.jsx" + - "**.module" + - "**.php" +exclude_paths: [] diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 000000000..1621caa9d --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,3 @@ +coverage_clover: build/logs/clover.xml +json_path: build/logs/coveralls-upload.json +service_name: travis-ci diff --git a/.travis.yml b/.travis.yml index 3c74aa463..724fdde77 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,12 +5,12 @@ php: - 7.1 - hhvm -addons: - hosts: - - tp.dev - - xn--o1af.xn--b1add - env: + global: + # Codacy + - secure: "SGpMIBqxA+7L3aDPuBWjoCZDrZh/cpxAkY7CWd7I+k/VVAgLWhUiYHWAf0FqzLjzogfgvQCZyWRJWKAXPv/gVRXsJkmpQu9+gzLuOOwW6WZUwE0w8L3+xV9vupZpeMhe4QkWxxHzH/B2X8R6oqQdc7dJXl7Q8+Gwag6wavBsU+k=" + # Code Climate + - secure: "A3c2mhe9lws+R40F4eltU0dzZfnra/h4fGXIYIhHvNfNWdhn88xp1tsuH/CGgj7gcNtp7nliwKQFyO8fPWr3LfpQFn9Vol3NSW8mJcg/8KCBPWTJmR9w9h3tPzJMW3q5w+TvUwXEFekyPIYgQ1k3DSzSi2fTNUWrsKMofiGJUqc=" matrix: - COMPOSER_FLAGS="--prefer-lowest" - COMPOSER_FLAGS="" @@ -20,18 +20,29 @@ matrix: - php: hhvm notifications: - slack: torrentpier:ogxFfuvXqBpthIAq4ubyBDxu + slack: + secure: "ManLobpQIesTlURzcGocIlRLLRfxMcAgnzZOJu9OiEGB3+usgmforhEv5cXIexyy6HnOA1S0NMrUlWnCL90kViT3vlLC+afMPjcUBA1IyiP2ITRqLzFrgB3PhhiZGjNUarKDElj/b+9a5eWRHvOTYnbRK9vTakNOtid83V05CJ8=" before_script: - travis_retry composer self-update - travis_retry composer install --no-interaction --prefer-dist script: - - vendor/bin/phpunit --configuration phpunit.xml --coverage-clover=coverage.xml + - mkdir -p build/logs + - vendor/bin/phpunit --configuration phpunit.xml --coverage-clover=build/logs/clover.xml after_script: - - php vendor/bin/codacycoverage clover coverage.xml - - php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.xml + - if [ $TRAVIS_PULL_REQUEST = 'false' ]; then php vendor/bin/codacycoverage clover build/logs/clover.xml; fi + - php vendor/bin/ocular code-coverage:upload --format=php-clover build/logs/clover.xml + - php vendor/bin/coveralls -v + - if [ $TRAVIS_PULL_REQUEST = 'false' ]; then php vendor/bin/test-reporter; fi after_success: - bash <(curl -s https://codecov.io/bash) + +addons: + hosts: + - tp.dev + - xn--o1af.xn--b1add + code_climate: + repo_token: $CODECLIMATE_REPO_TOKEN diff --git a/composer.json b/composer.json index 8e0570c14..1be64300d 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,9 @@ }, "require-dev": { "codacy/coverage": "dev-master", + "codeclimate/php-test-reporter": "dev-master", "phpunit/phpunit": "^5.0", + "satooshi/php-coveralls" : "^1.0", "sebastian/phpcpd": "2.0.*", "scrutinizer/ocular": "^1.3", "squizlabs/php_codesniffer": "2.7.*"