Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 42 #52

Merged
merged 2 commits into from
Sep 16, 2018
Merged
Changes from all commits
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
117 changes: 79 additions & 38 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,91 @@
# Java Maven CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-java/ for more details
#
default: &default
working_directory: ~/repo
docker:
- image: circleci/openjdk:8-jdk
version: 2
jobs:
build:
machine: true
working_directory: ~/code
code_checkout:
<<: *default
steps:
- run:
name: Install Docker Compose
command: |
curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/local/bin/docker-compose
- setup_remote_docker
- run:
name: Start container and verify it's working
command: |
set -x
docker-compose up -d
docker run --network container:contacts \
appropriate/curl --retry 10 --retry-delay 1 --retry-connrefused http://localhost:8080/contacts/test
- run:
name: Launch emulator
command: export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && emulator64-arm -avd test -noaudio -no-boot-anim -no-window -accel on
background: true
- checkout
- save_cache:
key: repo-{{ .Branch }}-{{ .Revision }}
paths:
- ~/repo
resolve_dependencies:
<<: *default
steps:
- restore_cache:
keys:
- v1-dependencies-{{ checksum "pom.xml" }}
- v1-dependencies-
- repo-{{ .Branch }}-{{ .Revision }}
- run:
name: Resolve dependencies
command: mvn dependency:go-offline
name: Resolve Dependencies
command: mvn dependency:resolve
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "pom.xml" }}
key: repo-dependency-{{ .Branch }}-{{ .Revision }}
build:
<<: *default
steps:
- restore_cache:
keys:
- repo-{{ .Branch }}-{{ .Revision }}
- repo-dependency-{{ .Branch }}-{{ .Revision }}
- run:
name: Wait for emulator
command: |
chmod +x ~/code/script/android-wait-for-boot.sh;
~/code/script/android-wait-for-boot.sh;
environment:
TERM: dumb
name: Build project
command: mvn clean install -DskipTests=true
- save_cache:
key: repo-target-{{ .Branch }}-{{ .Revision }}
paths:
- target/
test:
<<: *default
steps:
- restore_cache:
keys:
- repo-{{ .Branch }}-{{ .Revision }}
- repo-dependencies-{{ .Branch }}-{{ .Revision }}
- repo-target-{{ .Branch }}-{{ .Revision }}
- run:
name: Run Tests with Sonar Coverage
command: mvn org.jacoco:jacoco-maven-plugin:prepare-agent install -Pcoverage-per-test
- save_cache:
key: repo-reports-{{ .Branch }}-{{ .Revision }}
paths:
- reports/
code_analysis:
<<: *default
steps:
- restore_cache:
keys:
- repo-{{ .Branch }}-{{ .Revision }}
- repo-dependencies-{{ .Branch }}-{{ .Revision }}
- repo-target-{{ .Branch }}-{{ .Revision }}
- repo-reports-{{ .Branch }}-{{ .Revision }}
- run:
name: Run UI Tests
command: mvn integration-test
name: Update Sonar Analysis
command: mvn package sonar:sonar -Dsonar.host.url=$SONAR_HOST -Dsonar.organization=$SONAR_ORG -Dsonar.login=$SONAR_KEY

filters: &all_branches
branches:
only:
- develop
- master
- release
- /issue-.*/

workflows:
version: 2
normal_flow:
jobs:
- code_checkout:
filters: *all_branches
- resolve_dependencies:
filters: *all_branches
requires:
- code_checkout
- build:
filters: *all_branches
requires:
- resolve_dependencies