.circleci/config.yml
# Java Gradle CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-java/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/android:api-29
working_directory: ~/repo
environment:
# Customize the JVM maximum heap limit
JVM_OPTS: -Xmx3200m
TERM: dumb
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.gradle" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Download Dependencies
command: ./gradlew dependencies
- save_cache:
paths:
- ~/.gradle
key: v1-dependencies-{{ checksum "build.gradle" }}
- run:
name: ktlint - main
command: ./gradlew ktlintMainSourceSetCheck
- run:
name: ktlint - test
command: ./gradlew ktlintTestSourceSetCheck
- run:
name: Run Tests
command: ./gradlew test
- run:
name: Save Test Results
command: |
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/junit/ \;
when: always
- store_artifacts:
path: ~/test-results/junit
# store test results
- store_test_results:
path: library
# Build the jar files.
- run: ./gradlew jar kotlinSourcesJar
- store_artifacts:
path: library/build/libs
docs:
docker:
- image: circleci/android:api-29
working_directory: ~/repo
environment:
# Customize the JVM maximum heap limit
JVM_OPTS: -Xmx3200m
TERM: dumb
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.gradle" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: ./gradlew dependencies
- save_cache:
paths:
- ~/.gradle
key: v1-dependencies-{{ checksum "build.gradle" }}
# Deploy the docs
- run: ./gradlew orchidDeploy
workflows:
version: 2
pr-check:
jobs:
- build:
filters:
branches:
ignore: gh-pages
doc-publish:
jobs:
- docs:
filters:
branches:
only:
- master