Skip to content

Commit 2d5e0e5

Browse files
authored
Merge pull request #788 from wordpress-mobile/circleci
Add CircleCI config
2 parents 4455651 + ac08502 commit 2d5e0e5

File tree

5 files changed

+85
-2
lines changed

5 files changed

+85
-2
lines changed

.circleci/config.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
version: 2.1
2+
3+
orbs:
4+
android: wordpress-mobile/[email protected]
5+
6+
jobs:
7+
Lint:
8+
executor:
9+
name: android/default
10+
api-version: "27"
11+
steps:
12+
- checkout
13+
- android/restore-gradle-cache:
14+
cache-prefix: lint
15+
- run:
16+
name: klint
17+
command: ./gradlew --stacktrace ktlint
18+
- run:
19+
name: Lint
20+
command: ./gradlew --stacktrace lintRelease
21+
- android/save-gradle-cache:
22+
cache-prefix: lint
23+
- store_artifacts:
24+
path: aztec/build/reports
25+
destination: reports
26+
Unit Tests:
27+
executor:
28+
name: android/default
29+
api-version: "27"
30+
steps:
31+
- checkout
32+
- android/restore-gradle-cache:
33+
cache-prefix: unit-tests
34+
- run:
35+
name: Unit tests
36+
command: ./gradlew --stacktrace -PtestsMaxHeapSize=1536m aztec:testRelease
37+
- android/save-gradle-cache:
38+
cache-prefix: unit-tests
39+
- android/save-test-results
40+
Connected Tests:
41+
executor:
42+
name: android/default
43+
api-version: "27"
44+
steps:
45+
- checkout
46+
- android/restore-gradle-cache:
47+
cache-prefix: connected-tests
48+
- run:
49+
name: Build
50+
command: ./gradlew --stacktrace app:assembleDebug app:assembleDebugAndroidTest
51+
- run:
52+
name: Decrypt credentials
53+
command: openssl aes-256-cbc -md sha256 -d -in .firebase.secrets.json.enc -out .firebase.secrets.json -k "${FIREBASE_SECRETS_ENCRYPTION_KEY}"
54+
- run:
55+
name: Authenticate gcloud
56+
command: gcloud auth activate-service-account --key-file .firebase.secrets.json
57+
- run:
58+
name: Run Tests
59+
no_output_timeout: 20m
60+
command: |
61+
gcloud firebase test android run --type instrumentation \
62+
--app app/build/outputs/apk/debug/app-debug.apk \
63+
--test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
64+
--device model=Nexus5X,version=26,locale=en,orientation=portrait \
65+
--project api-project-108380595987 \
66+
--timeout 10m \
67+
--verbosity info
68+
- android/save-gradle-cache:
69+
cache-prefix: connected-tests
70+
71+
workflows:
72+
AztecEditor-Android:
73+
jobs:
74+
- Lint
75+
- Unit Tests
76+
- Connected Tests

.firebase.secrets.json.enc

32 Bytes
Binary file not shown.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ env:
2121

2222
before_install:
2323
# Decrypt secret.json (firebase access)
24-
- openssl aes-256-cbc -K $encrypted_3480988b28c1_key -iv $encrypted_3480988b28c1_iv -in .firebase.secrets.json.enc -out .firebase.secrets.json -d
24+
- openssl aes-256-cbc -md sha256 -d -in .firebase.secrets.json.enc -out .firebase.secrets.json -k "${FIREBASE_SECRETS_ENCRYPTION_KEY}"
2525

2626
script:
2727
# Build

aztec/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ android {
2727
testOptions {
2828
unitTests {
2929
includeAndroidResources = true
30+
all {
31+
if (project.hasProperty('testsMaxHeapSize')) {
32+
// maxHeapSize for tests is not limited unless we give an explicit value
33+
// See https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html
34+
maxHeapSize project.properties.get('testsMaxHeapSize')
35+
}
36+
}
3037
}
3138
}
3239
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
1212
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13-
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
13+
org.gradle.jvmargs=-Xmx1536m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
1414

1515
# When configured, Gradle will run in incubating parallel mode.
1616
# This option should only be used with decoupled projects. More details, visit

0 commit comments

Comments
 (0)