Compare commits

...

1 commit

Author SHA1 Message Date
svc-excavator-bot
f434970c51 Excavator: Automatically convert to Circle2 2020-12-17 11:59:26 +00:00
2 changed files with 131 additions and 66 deletions

View file

@ -1,90 +1,153 @@
version: 2 # 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.1
jobs: jobs:
compile: compile:
docker: [{ image: 'circleci/openjdk:8-node' }] docker: [{ image: 'circleci/openjdk:8u222-stretch-node' }]
resource_class: medium+ resource_class: large
environment:
CIRCLE_TEST_REPORTS: /home/circleci/junit
CIRCLE_ARTIFACTS: /home/circleci/artifacts
GRADLE_OPTS: -Dorg.gradle.jvmargs='-XX:MaxMetaspaceSize=256m' -Dorg.gradle.workers.max=4
_JAVA_OPTIONS: -XX:ActiveProcessorCount=4 -Xmx1177m -XX:MaxMetaspaceSize=512m -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
steps: steps:
- checkout - 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: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } - restore_cache: { key: 'compile-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --profile --parallel --stacktrace resolveConfigurations - run: ./gradlew --parallel --stacktrace classes testClasses
- save_cache: - save_cache:
key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
paths: [ ~/.gradle/wrapper ] paths: [ ~/.gradle/wrapper ]
- save_cache: - save_cache:
key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' key: 'compile-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ] paths: [ ~/.gradle/caches ]
- run: ./gradlew --profile --parallel --stacktrace classes testClasses - store_test_results: { path: ~/junit }
- store_artifacts: { path: ~/artifacts }
- persist_to_workspace: - persist_to_workspace:
root: . root: /home/circleci
paths: [ . ] paths: [ project, .gradle/init.gradle ]
compile-jdk11:
docker: [{ image: 'circleci/openjdk:11-node' }]
resource_class: medium+
steps:
- checkout
- restore_cache: { key: 'gradle-wrapper-v2-jdk11-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'gradle-cache-v2-jdk11-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --profile --parallel --stacktrace resolveConfigurations
- save_cache:
key: 'gradle-wrapper-v2-jdk11-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
paths: [ ~/.gradle/wrapper ]
- save_cache:
key: 'gradle-cache-v2-jdk11-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ]
- run: ./gradlew --profile --parallel --stacktrace classes testClasses
check: check:
docker: [{ image: 'circleci/openjdk:8-node' }] docker: [{ image: 'circleci/openjdk:8u222-stretch-node' }]
resource_class: medium+ resource_class: medium
environment:
CIRCLE_TEST_REPORTS: /home/circleci/junit
CIRCLE_ARTIFACTS: /home/circleci/artifacts
GRADLE_OPTS: -Dorg.gradle.jvmargs='-XX:MaxMetaspaceSize=256m' -Dorg.gradle.workers.max=2
_JAVA_OPTIONS: -XX:ActiveProcessorCount=2 -Xmx938m -XX:MaxMetaspaceSize=512m -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
steps: steps:
- attach_workspace: { at: . } - attach_workspace: { at: /home/circleci }
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } - restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } - restore_cache: { key: 'check-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- restore_cache: { key: 'graal-cache' } - run: ./gradlew --parallel --stacktrace --continue check idea -x test
- run: (sudo apt-get update || sudo apt-get update) && sudo apt-get install build-essential zlib1g-dev
- run: ./gradlew --profile --parallel --stacktrace --continue check
- save_cache: - save_cache:
key: 'graal-cache' key: 'check-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches/com.palantir.graal ] paths: [ ~/.gradle/caches ]
- store_test_results: { path: build/test-results } - run:
- store_artifacts: { path: build/reports/tests } 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 }
check-jdk11: unit-test:
docker: [{ image: 'circleci/openjdk:11-node' }] docker: [{ image: 'circleci/openjdk:8u222-stretch-node' }]
resource_class: medium+ resource_class: large
environment:
CIRCLE_TEST_REPORTS: /home/circleci/junit
CIRCLE_ARTIFACTS: /home/circleci/artifacts
GRADLE_OPTS: -Dorg.gradle.jvmargs='-XX:MaxMetaspaceSize=256m' -Dorg.gradle.workers.max=4
_JAVA_OPTIONS: -XX:ActiveProcessorCount=4 -Xmx1177m -XX:MaxMetaspaceSize=512m -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
steps: steps:
- checkout - attach_workspace: { at: /home/circleci }
- restore_cache: { key: 'gradle-wrapper-v2-jdk11-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } - restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'gradle-cache-v2-jdk11-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } - restore_cache: { key: 'unit-test-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- restore_cache: { key: 'graal-cache' } - run: ./gradlew --parallel --stacktrace --continue --max-workers=2 test
- run: (sudo apt-get update || sudo apt-get update) && sudo apt-get install build-essential zlib1g-dev
- run: ./gradlew --profile --parallel --stacktrace --continue check
- save_cache: - save_cache:
key: 'graal-cache' key: 'unit-test-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches/com.palantir.graal ] paths: [ ~/.gradle/caches ]
- store_test_results: { path: build/test-results } - run:
- store_artifacts: { path: build/reports/tests } 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: trial-publish:
docker: [{ image: 'circleci/openjdk:8-node' }] docker: [{ image: 'circleci/openjdk:8u222-stretch-node' }]
resource_class: medium
environment:
CIRCLE_TEST_REPORTS: /home/circleci/junit
CIRCLE_ARTIFACTS: /home/circleci/artifacts
GRADLE_OPTS: -Dorg.gradle.jvmargs='-XX:MaxMetaspaceSize=256m' -Dorg.gradle.workers.max=2
_JAVA_OPTIONS: -XX:ActiveProcessorCount=2 -Xmx938m -XX:MaxMetaspaceSize=512m -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
steps: steps:
- attach_workspace: { at: . } - attach_workspace: { at: /home/circleci }
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } - restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } - restore_cache: { key: 'trial-publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --profile --stacktrace publishToMavenLocal - run: ./gradlew --stacktrace publishToMavenLocal
- run:
command: git status --porcelain
when: always
- 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: publish:
docker: [{ image: 'circleci/openjdk:8-node' }] docker: [{ image: 'circleci/openjdk:8u222-stretch-node' }]
resource_class: medium
environment:
CIRCLE_TEST_REPORTS: /home/circleci/junit
CIRCLE_ARTIFACTS: /home/circleci/artifacts
GRADLE_OPTS: -Dorg.gradle.jvmargs='-XX:MaxMetaspaceSize=256m' -Dorg.gradle.workers.max=2
_JAVA_OPTIONS: -XX:ActiveProcessorCount=2 -Xmx938m -XX:MaxMetaspaceSize=512m -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
steps: steps:
- attach_workspace: { at: . } - attach_workspace: { at: /home/circleci }
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } - restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } - restore_cache: { key: 'publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- deploy: - deploy:
command: ./gradlew --profile --parallel --stacktrace --continue publish command: ./gradlew --parallel --stacktrace --continue publish
- deploy: - run:
command: ./gradlew --profile --parallel --stacktrace -Pgradle.publish.key=$GRADLE_KEY -Pgradle.publish.secret=$GRADLE_SECRET publishPlugins command: git status --porcelain
when: always
- 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:
- checkout
- run: /liche -d . -r . -v
workflows: workflows:
version: 2 version: 2
@ -93,21 +156,21 @@ workflows:
- compile: - compile:
filters: { tags: { only: /.*/ } } filters: { tags: { only: /.*/ } }
- unit-test:
requires: [ compile ]
filters: { tags: { only: /.*/ } }
- check: - check:
requires: [ compile ] requires: [ compile ]
filters: { tags: { only: /.*/ } } filters: { tags: { only: /.*/ } }
- compile-jdk11: - markdown:
filters: { tags: { only: /.*/ } }
- check-jdk11:
requires: [ compile-jdk11 ]
filters: { tags: { only: /.*/ } } filters: { tags: { only: /.*/ } }
- trial-publish: - trial-publish:
requires: [ compile ] requires: [ compile ]
filters: { branches: { ignore: develop } }
- publish: - publish:
requires: [ check, check-jdk11 ] requires: [ unit-test, check, trial-publish ]
filters: { tags: { only: /.*/ }, branches: { only: develop } } filters: { tags: { only: /.*/ }, branches: { only: develop } }

2
.circleci/template.sh Normal file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env bash
export CIRCLECI_TEMPLATE=java-library-oss