diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..4defc3b87 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,77 @@ +# This file was generated by the excavator check 'excavator/manage-circleci' as specified in .circleci/template.sh. +# To request a modification to the general template, file an issue on Excavator. +# To manually manage the CircleCI configuration for this project, remove the .circleci/template.sh file. + +version: 2 +jobs: + build: + docker: + - image: circleci/openjdk:8u171-jdk-node-browsers + resource_class: xlarge + environment: + GRADLE_OPTS: -Dorg.gradle.console=plain -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false + + steps: + - checkout + - restore_cache: + key: gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }} + - restore_cache: + key: gradle-cache-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }} + + - run: ./gradlew --parallel resolveConfigurations + + - save_cache: + key: gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }} + paths: + - ~/.gradle/wrapper + - save_cache: + key: gradle-cache-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }} + paths: + - ~/.gradle/caches + + - run: ./gradlew --parallel --continue build + + - run: + command: | + mkdir -p ~/junit + find . -type f -regex ".*/build/.*TEST.*xml" -exec cp --parents {} ~/junit/ \; + when: always + - store_test_results: + path: ~/junit + - store_artifacts: + path: ~/junit + + - run: + command: | + mkdir -p ~/reports + find . -type f -regex ".*/build/reports/.*" -exec cp --parents {} ~/reports/ \; + when: always + - store_test_results: + path: ~/reports + - store_artifacts: + path: ~/reports + + - deploy: + command: | + # publishing snapshots to bintray does not work, so we only publish from tag builds (not develop) + if [[ "${CIRCLE_TAG}" =~ [0-9]+(\.[0-9]+)+(-[a-zA-Z]+[0-9]*)* ]]; then + ./gradlew --stacktrace --continue publish + else + ./gradlew --parallel --continue publishToMavenLocal + mkdir -p ~/poms + find . -name 'pom-default.xml' -exec cp --parents {} ~/poms \; + fi + + - store_artifacts: + path: ~/poms + +workflows: + version: 2 + build: + jobs: + - build: + filters: + # CircleCI2 will ignore tags without this. https://circleci.com/docs/2.0/workflows/#git-tag-job-execution + tags: + only: /.*/ + diff --git a/build.gradle b/build.gradle index de18c9758..b89942d98 100644 --- a/build.gradle +++ b/build.gradle @@ -84,10 +84,6 @@ allprojects { } } tasks.check.dependsOn(javadoc) - - if (System.env.CIRCLE_TEST_REPORTS) { - test.reports.junitXml.destination = new File(System.env.CIRCLE_TEST_REPORTS, it.getName()) - } } dependencies { diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 0a711a778..000000000 --- a/circle.yml +++ /dev/null @@ -1,38 +0,0 @@ -machine: - pre: - - mkdir -p ~/.gradle && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties - java: - version: oraclejdk8 - environment: - TERM: dumb - _JAVA_OPTIONS: "-Xmx512M -XX:+HeapDumpOnOutOfMemoryError -verbose:gc -XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:-TraceClassUnloading -Xloggc:build-%t-%p.gc.log" - -checkout: - post: - - git tag --list | xargs git tag --delete - - git fetch --tags - - git describe --tags --always - -dependencies: - override: - - ./gradlew assemble compileTestJava --console=plain --stacktrace - -test: - override: - - ./gradlew check --parallel --continue - post: - - mkdir -p $CIRCLE_TEST_REPORTS/junit/ - - find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \; - - mkdir -p $CIRCLE_TEST_REPORTS/reports/ - - find . -type f -regex ".*/build/reports/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/reports/ \; - - mkdir -p $CIRCLE_ARTIFACTS/heapdumps: - parallel: true - - find . -type f -name "*.hprof" -o -name "*.gc.log" -exec cp {} $CIRCLE_ARTIFACTS/heapdumps \;: - parallel: true - -deployment: - releases: - tag: /[0-9]+(\.[0-9]+)+(-[a-zA-Z]+[0-9]*)*/ - owner: palantir - commands: - - ./gradlew bintrayUpload -x check --stacktrace --info