machine:
  java:
    version: oraclejdk8
dependencies:
  override:
    - ./gradlew dependencies
test:
  override:
    - ./gradlew check
  post:
    - mkdir -p $CIRCLE_TEST_REPORTS/junit/
    - find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
    - find . -type f -regex ".*/build/integrationTest-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;

machine:
  services:
    - docker
dependencies:
  override:
    - docker --version
    - docker-compose --version
    - ./go gradle compileTestJava
  cache_directories:
    - ~/.gradle
test:
  override:
    - ./go build
  post:
    - mkdir -p $CIRCLE_TEST_REPORTS/junit/
    - find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
    - find . -type f -regex ".*/build/integrationTest-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;

Use Docker for Circle CI build
Use Docker for Circle CI build

Also cache Gradle dependencies using workaround from
https://discuss.circleci.com/t/effective-caching-for-gradle/540/2
