From cac2d96a2016c20d65410e60f5803daec6942788 Mon Sep 17 00:00:00 2001 From: Daniel Beere Date: Thu, 30 Jan 2020 18:24:58 +0000 Subject: [PATCH 1/2] Create .circleci/config.yml --- .circleci/config.yml | 102 +++++-------------------------------------- 1 file changed, 11 insertions(+), 91 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff5cebbc..01c267cc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,93 +1,13 @@ -version: 2 -jobs: - build: - environment: - # Configure the JVM and Gradle to avoid OOM errors - _JAVA_OPTIONS: "-Xmx3g" - GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2" - docker: - - image: circleci/openjdk:11.0.3-jdk-stretch - steps: - - checkout - - restore_cache: - key: v1-gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }} - - restore_cache: - key: v1-gradle-cache-{{ checksum "build.gradle" }} - - run: - name: Install dependencies - command: ./gradlew build -x test - - save_cache: - paths: - - ~/.gradle/wrapper - key: v1-gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }} - - save_cache: - paths: - - ~/.gradle/caches - key: v1-gradle-cache-{{ checksum "build.gradle" }} - - persist_to_workspace: - root: . - paths: - - build - test: - # Remove if parallelism is not desired - parallelism: 2 - environment: - # Configure the JVM and Gradle to avoid OOM errors - _JAVA_OPTIONS: "-Xmx3g" - GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2" - docker: - - image: circleci/openjdk:11.0.3-jdk-stretch - - image: circleci/postgres:12-alpine - environment: - POSTGRES_USER: postgres - POSTGRES_DB: circle_test - steps: - - checkout - - attach_workspace: - at: . - - run: - name: Run tests in parallel - # Use "./gradlew test" instead if tests are not run in parallel - command: | - cd src/test/java - # Get list of classnames of tests that should run on this node - CLASSNAMES=$(circleci tests glob "**/*.java" \ - | cut -c 1- | sed 's@/@.@g' \ - | sed 's/.\{5\}$//' \ - | circleci tests split --split-by=timings --timings-type=classname) - cd ../../.. - # Format the arguments to "./gradlew test" - GRADLE_ARGS=$(echo $CLASSNAMES | awk '{for (i=1; i<=NF; i++) print "--tests",$i}') - echo "Prepared arguments for Gradle: $GRADLE_ARGS" - ./gradlew test $GRADLE_ARGS - - run: - name: Generate code coverage report - command: - ./gradlew jacocoTestReport - - store_test_results: - path: build/test-results/test - - store_artifacts: - path: build/test-results/test - when: always - - store_artifacts: - path: build/reports/jacoco/test/html - when: always - - run: - name: Assemble JAR - command: | - # Skip this for other nodes - if [ "$CIRCLE_NODE_INDEX" == 0 ]; then - ./gradlew assemble - fi - # This will be empty for all nodes except the first one - - store_artifacts: - path: build/libs - +# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference +version: 2.1 +# Use a package of configuration called an orb. +orbs: + # Declare a dependency on the welcome-orb + welcome: circleci/welcome-orb@0.4.1 +# Orchestrate or schedule a set of jobs workflows: - version: 2 - workflow: + # Name the workflow "welcome" + welcome: + # Run the welcome/run job in its own container jobs: - - build - - test: - requires: - - build \ No newline at end of file + - welcome/run \ No newline at end of file From 78b5a4590fa8635ad28bc1cb8d7f2552617f827d Mon Sep 17 00:00:00 2001 From: Daniel Beere Date: Thu, 30 Jan 2020 18:49:11 +0000 Subject: [PATCH 2/2] Create .circleci/config.yml