Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ on:
branches:
- dev
- master





jobs:
build:
Expand All @@ -35,4 +31,4 @@ jobs:
- name: Install NDK
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
- name: Build with Gradle
run: ./gradlew build check
run: ./gradlew build
28 changes: 28 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Testing Workflow

on:
push:
branches:
- dev
- master
pull_request:
branches:
- dev
- master


jobs:
test:

runs-on: [ubuntu-18.04]

steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Run unit tests
run: ./gradlew check
- name: upload code coverage
run: bash <(curl -s https://codecov.io/bash)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

![Tests](https://img.shields.io/github/workflow/status/OpenMined/KotlinSyft/Tests)
![Coverage](https://img.shields.io/codecov/c/github/OpenMined/KotlinSyft)
![Android CI](https://github.com/OpenMined/KotlinSyft/workflows/Android%20CI/badge.svg)
![Tests](https://img.shields.io/github/workflow/status/OpenMined/KotlinSyft/tests)
![Coverage](https://img.shields.io/codecov/c/github/OpenMined/KotlinSyft/dev)
![build](https://github.com/OpenMined/KotlinSyft/workflows/Android%20CI/badge.svg)
![License](https://img.shields.io/github/license/OpenMined/KotlinSyft)
![OpenCollective](https://img.shields.io/opencollective/all/openmined)

Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ buildscript {
classpath ProjectDependencies.netflixPublishingPlugin
classpath ProjectDependencies.netflixReleasePlugin
classpath ProjectDependencies.netflixBintrayPlugin
classpath ProjectDependencies.jacoco
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ object Versions {
const val netflixPublishing = "14.0.0"
const val netflixRelease = "13.0.0"
const val netflixBintray = "3.5.4"
const val jacocoVersion = "0.8.2"

// Test
const val junit = "1.1.1"
Expand All @@ -57,6 +58,7 @@ object ProjectDependencies {
Versions.netflixRelease
const val netflixBintrayPlugin = "com.netflix.nebula:nebula-bintray-plugin:" +
Versions.netflixBintray
const val jacoco = "org.jacoco:org.jacoco.core:" + Versions.jacocoVersion
}

object CommonDependencies {
Expand Down
39 changes: 38 additions & 1 deletion syftlib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,41 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlinx-serialization'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'jacoco'
apply from: 'publish.gradle'

jacoco {
toolVersion = Versions.jacocoVersion
}

check.finalizedBy "jacocoTestReport"

tasks.withType(Test) {
useJUnitPlatform()
}

task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {

reports {
xml.enabled = true
html.enabled = true
}

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

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

android {
compileSdkVersion Versions.compileSdk
buildToolsVersion Versions.buildTools


defaultConfig {
minSdkVersion Versions.minSdk
targetSdkVersion Versions.targetSdk
Expand All @@ -20,6 +48,9 @@ android {
}

buildTypes {
debug {
testCoverageEnabled = true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
Expand All @@ -32,6 +63,12 @@ android {

testOptions {
unitTests.returnDefaultValues = true
unitTests.all {
jacoco {
jacoco.includeNoLocationClasses = true

}
}
}

lintOptions {
Expand Down