Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/develop' into dfox/try-java-13
  • Loading branch information
iamdanfox committed Aug 22, 2019
commit a4dec85d2c3773d2868c3140c0ff2e9464f62ed9
149 changes: 29 additions & 120 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,38 @@

version: 2
jobs:
compile:
build:
docker: [{ image: 'circleci/openjdk:8u171-node' }]
resource_class: large
resource_class: xlarge
environment:
GRADLE_OPTS: -Dorg.gradle.console=plain -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false
CIRCLE_TEST_REPORTS: /home/circleci/junit
CIRCLE_ARTIFACTS: /home/circleci/artifacts
GRADLE_OPTS: -Dorg.gradle.jvmargs='-Xms6144m -Xmx6144m'
_JAVA_OPTIONS: '-Xmx2048m'
steps:
- checkout
- run:
name: delete_unrelated_tags
command: |
ALL_TAGS=$(git tag --points-at HEAD)

if [ -z "$ALL_TAGS" ]; then
echo "No-op as there are no tags on the current commit ($(git rev-parse HEAD))"
exit 0
fi

if [ -z "${CIRCLE_TAG:+x}" ]; then
echo "Non-tag build, deleting all tags which point to HEAD: [${ALL_TAGS/$'\n'/,}]"
echo "$ALL_TAGS" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done
exit 0
fi

TAGS_TO_DELETE=$(echo "$ALL_TAGS" | grep -v "^$CIRCLE_TAG$" || :)
if [ -z "$TAGS_TO_DELETE" ]; then
echo "No-op as exactly one tag ($CIRCLE_TAG) points to HEAD"
exit 0
fi

echo "Detected tag build, deleting all tags except '$CIRCLE_TAG' which point to HEAD: [${TAGS_TO_DELETE/$'\n'/,}]"
echo "$TAGS_TO_DELETE" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'compile-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --parallel --stacktrace classes testClasses
- restore_cache: { key: 'gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'gradle-cache-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --no-daemon --parallel --stacktrace --continue --max-workers=8 --profile build
- save_cache:
key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
key: 'gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
paths: [ ~/.gradle/wrapper ]
- save_cache:
key: 'compile-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ]
- store_test_results: { path: ~/junit }
- store_artifacts: { path: ~/artifacts }
- persist_to_workspace:
root: /home/circleci
paths: [ project, .gradle/init.gradle ]

check:
docker: [{ image: 'circleci/openjdk:8u171-node' }]
environment:
GRADLE_OPTS: -Dorg.gradle.jvmargs='-Xms3072m -Xmx3072m'
steps:
- attach_workspace: { at: /home/circleci }
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'check-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --parallel --stacktrace --continue check -x test
- save_cache:
key: 'check-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ]
- run:
command: mkdir -p ~/junit && find . -type f -regex ".*/build/.*TEST.*xml" -exec cp --parents {} ~/junit/ \;
when: always
- 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 --no-daemon --parallel --stacktrace --continue --max-workers=8 --profile publish
else
./gradlew --no-daemon --parallel --stacktrace --continue --max-workers=8 --profile publishToMavenLocal
mkdir -p $CIRCLE_ARTIFACTS/poms
find . -name 'pom-default.xml' -exec cp --parents {} $CIRCLE_ARTIFACTS/poms \;
fi
- store_test_results: { path: ~/junit }
- store_artifacts: { path: ~/artifacts }

Expand All @@ -78,70 +47,23 @@ jobs:
CIRCLE_TEST_REPORTS: /root/junit
CIRCLE_ARTIFACTS: /root/artifacts
_JAVA_OPTIONS: '-XX:ActiveProcessorCount=8 -Xmx2048m'
steps:
- attach_workspace: { at: /home/circleci }
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'unit-test-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --parallel --stacktrace --continue --max-workers=2 test
- save_cache:
key: 'unit-test-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ]
- 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: ~/artifacts }

unit-test-11:
docker: [{ image: 'circleci/openjdk:11-node' }]
resource_class: large
environment:
GRADLE_OPTS: -Dorg.gradle.jvmargs='-Xms6144m -Xmx6144m'
steps:
- checkout
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'unit-test-11-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --parallel --stacktrace --continue test
- restore_cache: { key: 'gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'gradle-cache-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --no-daemon --parallel --stacktrace --continue --profile build
- save_cache:
key: 'gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
paths: [ ~/.gradle/wrapper ]
- save_cache:
key: 'unit-test-11-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ]
- 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: ~/artifacts }

trial-publish:
docker: [{ image: 'circleci/openjdk:8u171-node' }]
environment:
GRADLE_OPTS: -Dorg.gradle.jvmargs='-Xms3072m -Xmx3072m'
steps:
- attach_workspace: { at: /home/circleci }
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'trial-publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --stacktrace publishToMavenLocal
- save_cache:
key: 'trial-publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ]
- store_test_results: { path: ~/junit }
- store_artifacts: { path: ~/artifacts }

publish:
docker: [{ image: 'circleci/openjdk:8u171-node' }]
environment:
GRADLE_OPTS: -Dorg.gradle.jvmargs='-Xms3072m -Xmx3072m'
steps:
- attach_workspace: { at: /home/circleci }
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- deploy:
command: ./gradlew --parallel --stacktrace --continue publish
- save_cache:
key: 'publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ]
- store_test_results: { path: ~/junit }
- store_artifacts: { path: ~/artifacts }

markdown:
docker: [{ image: 'raviqqe/liche:0.1.1' }]
steps:
Expand All @@ -152,25 +74,12 @@ workflows:
version: 2
build:
jobs:
- compile:
- build:
# CircleCI2 will ignore tags without this. https://circleci.com/docs/2.0/workflows/#git-tag-job-execution
filters: { tags: { only: /.*/ } }
- build-13:
# CircleCI2 will ignore tags without this. https://circleci.com/docs/2.0/workflows/#git-tag-job-execution
filters: { tags: { only: /.*/ } }

- unit-test-11:
filters: { tags: { only: /.*/ } }

- check:
requires: [ compile ]
filters: { tags: { only: /.*/ } }

- markdown:
# CircleCI2 will ignore tags without this. https://circleci.com/docs/2.0/workflows/#git-tag-job-execution
filters: { tags: { only: /.*/ } }

- trial-publish:
requires: [ compile ]

- publish:
requires: [ unit-test, unit-test-11, check ]
filters: { tags: { only: /.*/ }, branches: { only: develop } }
You are viewing a condensed version of this merge commit. You can view the full changes here.