Created
August 1, 2017 11:08
-
-
Save paulmwatson/276ac38c406405c7798f298a48033fe9 to your computer and use it in GitHub Desktop.
A CircleCI 2.0 configuration for getting code coverage from PHPUnit to Code Climate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
jobs: | |
build: | |
environment: | |
CC_TEST_REPORTER_ID: YOUR_CODE_CLIMATE_REPORTER_ID | |
docker: | |
- image: notnoopci/php:7.1.5-browsers | |
working_directory: ~/repo | |
steps: | |
- checkout | |
- run: sudo pecl channel-update pecl.php.net | |
- run: sudo pecl install xdebug && sudo docker-php-ext-enable xdebug | |
- run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | |
- run: chmod +x ./cc-test-reporter | |
- run: sudo mkdir -p $CIRCLE_TEST_REPORTS/phpunit | |
- run: ./cc-test-reporter before-build | |
- run: sudo vendor/bin/phpunit --coverage-clover clover.xml | |
- run: ./cc-test-reporter after-build -t clover --exit-code $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment