forked from mapbox/mapbox-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcircle.yml
More file actions
124 lines (122 loc) · 4.27 KB
/
Copy pathcircle.yml
File metadata and controls
124 lines (122 loc) · 4.27 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
version: 2
workflows:
version: 2
default:
jobs:
- build
- release
jobs:
build:
working_directory: ~/code
docker:
- image: mbgl/ci@sha256:c34e221294d81da80918d3e9a9df5de795b067e88f86d7c9a5e262763332536e
environment:
JVM_OPTS: -Xmx3200m
BUILDTYPE: Debug
IS_LOCAL_DEVELOPMENT: false
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "mapbox/build.gradle" }}-{{ checksum "mapbox/app/build.gradle" }}
- run:
name: Accept Android license
command: |
echo y | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;26.0.1"
- run:
name: Download Dependencies
command: cd mapbox && ./gradlew androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "mapbox/build.gradle" }}-{{ checksum "mapbox/app/build.gradle" }}
- run:
name: Check Java code style
command: make checkstyle
- run:
name: Run unit-test in Java libraries
command: make test-java
- run:
name: Run unit-test in Android libraries
command: make test-android
- run:
name: Build testapp APK
command: |
cd mapbox && ./gradlew accessToken
./gradlew app:assembleDebug
- run:
name: Log in to Google Cloud Platform
shell: /bin/bash -euo pipefail
command: |
echo "${GCLOUD_SERVICE_ACCOUNT_JSON}" > secret.json
gcloud auth activate-service-account --key-file secret.json --project mapbox-java
rm secret.json
- run:
name: Run instrumentation tests on Firebase
no_output_timeout: 1200
shell: /bin/bash -euo pipefail
command: |
gcloud firebase test android run --type robo --app mapbox/app/build/outputs/apk/app-debug.apk --device-ids shamu --os-version-ids 22 --locales en --orientations portrait --timeout 10m
- run:
name: Update Transifex
command: |
if [ "${CIRCLE_BRANCH}" == "${DEPLOY_BRANCH}" ]; then
pip install transifex-client
echo $'[https://www.transifex.com]\nhostname = https://www.transifex.com\nusername = '"${TRANSIFEX_USER}"$'\npassword = '"${TRANSIFEX_API_TOKEN}"$'\ntoken = '""$'\n' > ~/.transifexrc
tx push -s
else
echo "Skipping push to Transifex"
fi
- store_artifacts:
path: mapbox/app/build/reports
destination: reports
- store_test_results:
path: mapbox/app/build/test-results
# ------------------------------------------------------------------------------
release:
branch:
only:
- master
docker:
- image: mbgl/ci@sha256:c34e221294d81da80918d3e9a9df5de795b067e88f86d7c9a5e262763332536e
working_directory: ~/code
environment:
environment:
BUILDTYPE: Release
IS_LOCAL_DEVELOPMENT: false
steps:
- checkout
- run:
name: Accept Android license
command: |
echo y | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;26.0.1"
- run:
name: Generate Maven credentials
shell: /bin/bash -euo pipefail
command: |
aws s3 cp s3://mapbox/android/signing-credentials/secring.gpg secring.gpg
echo "NEXUS_USERNAME=$PUBLISH_NEXUS_USERNAME
NEXUS_PASSWORD=$PUBLISH_NEXUS_PASSWORD
signing.keyId=$SIGNING_KEYID
signing.password=$SIGNING_PASSWORD
signing.secretKeyRingFile=../../secring.gpg" >> mapbox/gradle.properties
- run:
name: Build Java libraries
command: make build-release-java
- run:
name: Build Android libraries
command: make build-release-android
- deploy:
name: Publish Java Services To Maven Central
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
make publish-java ;
fi
- deploy:
name: Publish Android Services To Maven Central
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
make publish-android ;
fi
- store_artifacts:
path: mapbox/app/build/reports
destination: reports