Skip to content
Browse files

Report code coverage to code climate

  • Loading branch information...
alsutton committed Aug 22, 2018
1 parent 1517f73 commit a3f7cc8ba576bf70492507941d6613c366e54ed9
Showing with 26 additions and 11 deletions.
  1. +26 −11 .circleci/config.yml
@@ -6,20 +6,14 @@ version: 2
# specify the version you desire here
- image: circleci/openjdk:8-jdk

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at
# - image: circleci/postgres:9.4

working_directory: ~/repo

# Customize the JVM maximum heap limit
JVM_OPTS: -Xmx3200m
TERM: dumb
JACOCO_SOURCE_PATH: src/main/java

- checkout
@@ -31,12 +25,33 @@ jobs:
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: gradle dependencies
- run:
name: Setup Code Climate test-reporter
command: |
curl -L > ./cc-test-reporter
chmod +x ./cc-test-reporter
- run:
name: Install dependencies
command: gradle dependencies

- save_cache:
- ~/.gradle
key: v1-dependencies-{{ checksum "build.gradle" }}

# run tests!
- run: gradle test

- run:
name: Setup Code Climate reporter for a build
command: ./cc-test-reporter before-build

- run:
name: Run the tests and generate the coverage report
command: gradle test jacocoTestReport

- run:
name: Report coverage stats to Code Climate
command: |
./cc-test-reporter format-coverage build/reports/jacoco/test/jacocoTestReport.xml --input-type jacoco
./cc-test-reporter upload-coverage

0 comments on commit a3f7cc8

Please sign in to comment.
You can’t perform that action at this time.