forked from AnySoftKeyboard/AnySoftKeyboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
66 lines (62 loc) · 3 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
machine:
java:
version: oraclejdk8
services:
- docker
environment:
CODECOV_TOKEN: 1a4cd171-2784-4f48-8a62-0b7ec31e6d7e
COV_REPORT_LOCATION: app/build/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml
DOCKER_IMAGE_NAME: menny/android_ndk
DOCKER_IMAGE_VERSION: 1.6.1a
DOCKER_IMAGE: ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION}
DOCKER_MOUNTS: -v ${HOME}/${CIRCLE_PROJECT_REPONAME}:/opt/workspace -v ${HOME}/.gradle:/root/.gradle -v ${HOME}/.m2:/root/.m2 -v ${HOME}/android_sdk_licenses:/opt/android-sdk-linux/licenses
DOCKER_ARGS: --rm --name workspace --env-file ${HOME}/env.list
dependencies:
cache_directories:
- "~/docker"
- "~/.gradle"
- "~/.m2"
override:
- mkdir -p ~/.gradle
- mkdir -p ~/.m2
# creating an env file from host into Docker
- printenv | grep -Ev '^(PATH|ANDROID|JAVA|PWD|SHELL|TERM|LANG|SSH|HOME|_)' > ${HOME}/env.list
# setting up docker and its initial state
- ${HOME}/${CIRCLE_PROJECT_REPONAME}/scripts/circleci_docker_image_cache.sh
- docker run ${DOCKER_ARGS} ${DOCKER_MOUNTS} ${DOCKER_IMAGE} /opt/workspace/scripts/ci_setup.sh
compile:
override:
- docker run ${DOCKER_ARGS} ${DOCKER_MOUNTS} ${DOCKER_IMAGE} /opt/workspace/scripts/ci_assemble.sh
post:
- mkdir -p $CIRCLE_ARTIFACTS/apks/
- cp app/build/outputs/apk/*.apk $CIRCLE_ARTIFACTS/apks/
test:
override:
- docker run ${DOCKER_ARGS} ${DOCKER_MOUNTS} ${DOCKER_IMAGE} /opt/workspace/scripts/ci_test.sh
post:
- mkdir -p $CIRCLE_ARTIFACTS/lint/app
- cp app/build/outputs/lint* $CIRCLE_ARTIFACTS/lint/app/
- mkdir -p $CIRCLE_ARTIFACTS/lint/base
- cp base/build/outputs/lint* $CIRCLE_ARTIFACTS/lint/base/
- mkdir -p $CIRCLE_ARTIFACTS/lint/jnidictionaryv1
- cp jnidictionaryv1/build/outputs/lint* $CIRCLE_ARTIFACTS/lint/jnidictionaryv1/
- mkdir -p $CIRCLE_ARTIFACTS/lint/jnidictionaryv2
- cp jnidictionaryv2/build/outputs/lint* $CIRCLE_ARTIFACTS/lint/jnidictionaryv2/
- mkdir -p $CIRCLE_ARTIFACTS/lint/nextword
- cp nextword/build/outputs/lint* $CIRCLE_ARTIFACTS/lint/nextword/
- mkdir -p $CIRCLE_ARTIFACTS/tests/app
- cp -r app/build/reports/tests $CIRCLE_ARTIFACTS/tests/app
# letting circleci know about the test results
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
- cp -r app/build/test-results/testDebugUnitTest/debug/*.xml $CIRCLE_TEST_REPORTS/junit/
# posts code-coverage to codecov.io
- if [[ -f $COV_REPORT_LOCATION ]]; then ./scripts/ci_binaries/codecov.sh -X gcov -X coveragepy -f $COV_REPORT_LOCATION; fi
deployment:
staging:
branch: master
owner: AnySoftKeyboard
commands:
- docker run ${DOCKER_ARGS} ${DOCKER_MOUNTS} ${DOCKER_IMAGE} /opt/workspace/scripts/ci_deploy.sh $KEYSTORE_FILE_URL $PUBLISH_CERT_FILE_URL
- cp app/build/outputs/apk/*.apk $CIRCLE_ARTIFACTS/apks/
- cp app/build/outputs/mapping/canary/mapping.txt $CIRCLE_ARTIFACTS/apks/ || true
- cp app/build/outputs/mapping/release/mapping.txt $CIRCLE_ARTIFACTS/apks/ || true