-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from WasiqB/issue-42
Issue 42
- Loading branch information
Showing
1 changed file
with
79 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |