-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
circle.yml
119 lines (117 loc) · 3.91 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
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
version: 2
workflows:
version: 2
default:
jobs:
- build
- release
jobs:
build:
working_directory: ~/code
docker:
- image: mbgl/android-ndk-r21:769c31f1d8
environment:
JVM_OPTS: -Xmx3200m
BUILDTYPE: Debug
IS_LOCAL_DEVELOPMENT: false
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
- run:
name: Init submodules
command: git submodule update --init --recursive
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Run nitpick
command: ./gradlew plugin-annotation:nitpick
- run:
name: Check Java code style
command: make checkstyle
- run:
name: Run unit tests
command: make test
- run:
name: Generate Activity Sanity tests
command: make generate-sanity-test
- run:
name: Build testapp APK
command: |
./gradlew accessToken
./gradlew app:assembleDebug
- run:
name: Build Test APK
command: |
./gradlew app:assembleAndroidTest
- run:
name: Build release to test ProGuard rules
command: ./gradlew app:assembleRelease
- run:
name: Log in to Google Cloud Platform
command: |
if [ -n "${GCLOUD_SERVICE_ACCOUNT_JSON}" ]; then
echo "${GCLOUD_SERVICE_ACCOUNT_JSON}" > secret.json
gcloud auth activate-service-account --key-file secret.json --project mapbox-plugins-android-4e407
rm secret.json
fi
- run:
name: Run instrumentation tests on Firebase
no_output_timeout: 1200
command: |
if [ -n "${GCLOUD_SERVICE_ACCOUNT_JSON}" ]; then
gcloud firebase test android models list
gcloud firebase test android run --type instrumentation \
--app app/build/outputs/apk/debug/app-debug.apk \
--test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
--device-ids sailfish --os-version-ids 26 --locales en --orientations portrait --timeout 20m
fi
- store_artifacts:
path: app/build/reports
destination: reports
- store_test_results:
path: app/build/test-results
# ------------------------------------------------------------------------------
release:
docker:
- image: mbgl/android-ndk-r21:769c31f1d8
working_directory: ~/code
environment:
BUILDTYPE: Release
IS_LOCAL_DEVELOPMENT: false
steps:
- checkout
- run:
name: Init submodules
command: git submodule update --init --recursive
- run:
name: Generate Maven credentials
shell: /bin/bash -euo pipefail
command: |
if [ -n "${PUBLISH_NEXUS_USERNAME}" ]; then
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" >> gradle.properties
fi
- run:
name: Build Plugins SDK
command: make build-release
- deploy:
name: Publish Plugins SDK To Maven Central
command: |
if [ -n "${PUBLISH_NEXUS_USERNAME}" ]; then
if [ "${CIRCLE_BRANCH}" == "main" ]; then
make publish
fi
fi
- store_artifacts:
path: app/build/reports
destination: reports