Skip to content

Instantly share code, notes, and snippets.

@parj
Last active May 19, 2019 10:46
Show Gist options
  • Save parj/644a631ba11ab92c468afd1a01844b33 to your computer and use it in GitHub Desktop.
Save parj/644a631ba11ab92c468afd1a01844b33 to your computer and use it in GitHub Desktop.
CircleCI default java build
openjdk-8:
docker:
# specify the version you desire here
- image: circleci/openjdk:8-jdk
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4
working_directory: ~/repo-8
environment:
# Customize the JVM maximum heap limit
MAVEN_OPTS: -Xmx3200m
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "pom.xml" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: mvn dependency:go-offline
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "pom.xml" }}
- run:
name: Add GPG key
command: .travis/importKeys.sh
# run tests!
- run:
name: Run unit tests
command: mvn test
- run:
name: Save test results
command: |
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
when: always
- store_test_results:
path: ~/test-results
- store_artifacts:
path: ~/test-results/junit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment