gradle-graal/.circleci/config.yml
2019-06-07 17:15:59 +00:00

74 lines
3 KiB
YAML

version: 2
jobs:
compile:
docker: [{ image: 'circleci/openjdk:8-node' }]
resource_class: medium+
steps:
- checkout
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --profile --parallel --stacktrace resolveConfigurations
- save_cache:
key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
paths: [ ~/.gradle/wrapper ]
- save_cache:
key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ]
- run: ./gradlew --profile --parallel --stacktrace classes testClasses
- persist_to_workspace:
root: .
paths: [ . ]
check:
docker: [{ image: 'circleci/openjdk:8-node' }]
resource_class: medium+
steps:
- attach_workspace: { at: . }
- 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: 'graal-cache' }
- run: sudo apt-get update && sudo apt-get install build-essential zlib1g-dev
- run: ./gradlew --profile --parallel --stacktrace --continue check
- save_cache:
key: 'graal-cache'
paths: [ ~/.gradle/caches/com.palantir.graal ]
- store_test_results: { path: build/test-results }
- store_artifacts: { path: build/reports/tests }
trial-publish:
docker: [{ image: 'circleci/openjdk:8-node' }]
steps:
- attach_workspace: { at: . }
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --profile --stacktrace publishToMavenLocal
publish:
docker: [{ image: 'circleci/openjdk:8-node' }]
steps:
- attach_workspace: { at: . }
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- deploy:
command: ./gradlew --profile --parallel --stacktrace --continue publish
- deploy:
command: ./gradlew --profile --parallel --stacktrace -Pgradle.publish.key=$GRADLE_KEY -Pgradle.publish.secret=$GRADLE_SECRET publishPlugins
workflows:
version: 2
build:
jobs:
- compile:
filters: { tags: { only: /.*/ } }
- check:
requires: [ compile ]
filters: { tags: { only: /.*/ } }
- trial-publish:
requires: [ compile ]
- publish:
requires: [ check ]
filters: { tags: { only: /.*/ }, branches: { only: develop } }