Skip to content

Commit c59b829

Browse files
committed
Migrate build from Travis CI to GitHub
Travis can barely handle builds that involve the Android emulator, anything above API level 19 doesn't even seem to start. GitHub Actions seems to do a better job.
1 parent 7a8b636 commit c59b829

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

.github/workflows/build_and_test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build and Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
timeout-minutes: 40
8+
runs-on: macOS-latest
9+
steps:
10+
- name: checkout
11+
uses: actions/checkout@v2
12+
- uses: actions/setup-java@v1
13+
with:
14+
# Robolectric requires Java 9 to emulate Android API level 30
15+
java-version: '9'
16+
- name: test
17+
uses: reactivecircus/android-emulator-runner@v2
18+
with:
19+
api-level: 28
20+
script: ./gradlew clean test --stacktrace

plugin/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ publishing {
3737
name = "mavenCentral"
3838
credentials {
3939
Properties properties = new Properties()
40-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
41-
40+
try {
41+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
42+
} catch(FileNotFoundException ignored) {
43+
logger.warn("local.properties file with ossrhUsername and ossrhPassword properties was not found.")
44+
}
4245
username = properties.getProperty("ossrhUsername")
4346
password = properties.getProperty("ossrhPassword")
4447
}

plugin/src/test/test-fixtures/multi-module/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ allprojects {
2626
google()
2727
mavenCentral()
2828
}
29+
tasks.withType(Test) {
30+
testLogging {
31+
exceptionFormat "full"
32+
}
33+
}
2934
}
3035

3136
task clean(type: Delete) {

0 commit comments

Comments
 (0)