Skip to content

Commit 1504747

Browse files
authored
Migrate build from Travis CI to GitHub (#31)
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 535dfaa commit 1504747

File tree

6 files changed

+31
-120
lines changed

6 files changed

+31
-120
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build
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

.travis.yml

Lines changed: 0 additions & 115 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/nl.neotech.plugin/android-root-coverage-plugin/maven-metadata.xml.svg?label=Gradle%20Plugin%20Portal)](https://plugins.gradle.org/plugin/nl.neotech.plugin.rootcoverage)
22
[![Maven Central](https://img.shields.io/maven-central/v/nl.neotech.plugin/android-root-coverage-plugin?label=Maven%20Central)](https://search.maven.org/artifact/nl.neotech.plugin/android-root-coverage-plugin)
3-
[![Build status](https://travis-ci.com/NeoTech-Software/Android-Root-Coverage-Plugin.svg?branch=master)](https://travis-ci.com/NeoTech-Software/Android-Root-Coverage-Plugin/)
3+
[![Build](https://github.com/NeoTech-Software/Android-Root-Coverage-Plugin/actions/workflows/build.yml/badge.svg)](https://github.com/NeoTech-Software/Android-Root-Coverage-Plugin/actions/workflows/build.yml)
44

55
# Android-Root-Coverage-Plugin
66
**A Gradle plugin for combined code coverage reports for Android projects.**

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/kotlin/org/neotech/plugin/rootcoverage/IntegrationTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class IntegrationTest(
3333
.withProjectDir(projectRoot)
3434
.withGradleVersion(gradleVersion)
3535
.withPluginClasspath()
36-
// Without forwardOutput Travis CI could timeout (which happens when Travis receives
37-
// no output for more than 10 minutes)
3836
.forwardStdOutput(SystemOutputWriter.out())
3937
.forwardStdError(SystemOutputWriter.err())
4038

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)