Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate family to circle ci #94

Merged
merged 7 commits into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Android CI with Gradle

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
unit_tests:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install NDK
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.0.6113669" --sdk_root=${ANDROID_SDK_ROOT}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run unit tests with Gradle
run: ./gradlew :opensrp-chw-family-planning:clean :opensrp-chw-family-planning:jacocoTestReport --stacktrace
- name: Upload coverage to Coveralls with Gradle
run: ./gradlew coveralls --stacktrace
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
60 changes: 0 additions & 60 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ buildscript {
repositories {
google()
mavenCentral()
maven{ url "https://plugins.gradle.org/m2/" }
}

dependencies {
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.11.0"
classpath 'gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.10.2'
}
}

Expand Down Expand Up @@ -49,6 +51,7 @@ subprojects {
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "https://cloudant.github.io/cloudant-sync-eap/repository" }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven{ url "https://plugins.gradle.org/m2/" }
mavenLocal()
}

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ POM_SETTING_DEVELOPER_NAME=OpenSRP Onadev
POM_SETTING_NAME=OpenSRP Client Chw Family Plannin
POM_SETTING_ARTIFACT_ID=opensrp-chw-family-planning
POM_SETTING_PACKAGING=aar
org.gradle.jvmargs=-Xmx2048M -XX\:MaxHeapSize\=32g
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Nov 27 22:05:16 EAT 2019
#Tue Dec 01 15:03:54 EAT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
19 changes: 11 additions & 8 deletions opensrp-chw-family-planning/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
classpath "com.android.tools.build:gradle:4.0.0"
}
}

Expand Down Expand Up @@ -72,7 +71,6 @@ android {
includeAndroidResources = true
}
}

}

tasks.withType(Test) {
Expand Down Expand Up @@ -166,18 +164,23 @@ task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'crea
getReports().getHtml().setDestination(file("${buildDir}/reports/jacoco/jacocoRootReport/html"))

def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*', '**/*$ViewBinder*.*']
def debugTree = fileTree(dir: "$project.buildDir/intermediates/classes/debug", excludes: fileFilter)
def debugTree = fileTree(dir: "$project.buildDir/intermediates/javac/debug/classes", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/java"

sourceDirectories = files([mainSrc])
classDirectories = files([debugTree])
executionData = fileTree(dir: project.buildDir, includes: [
sourceDirectories.from(files([mainSrc]))
classDirectories .from(files([debugTree]))
executionData.from(fileTree(dir: project.buildDir, includes: [
'jacoco/testDebugUnitTest.exec', 'outputs/code-coverage/connected/*coverage.ec'
])
]))
}

tasks.coveralls {
dependsOn 'jacocoTestReport'
}

coveralls {
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/merged.xml"
sourceDirs = ["$project.projectDir/src/main/java"]
}

apply from: '../maven.gradle'
3 changes: 1 addition & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
classpath "com.android.tools.build:gradle:4.0.0"
}
}

Expand Down