Skip to content

Commit

Permalink
Merge b125642 into 8cd6f75
Browse files Browse the repository at this point in the history
  • Loading branch information
tgianos committed May 25, 2018
2 parents 8cd6f75 + b125642 commit c5f9499
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 33 deletions.
3 changes: 3 additions & 0 deletions .codecov.yml
@@ -0,0 +1,3 @@
codecov:
branch: master
# strict_yaml_branch: master # Enable this if we want to use the yml file in master to dictate the reports for all branches
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -19,6 +19,8 @@ before_script:
- mysql -u root -e 'create database genie;'
- mysql -u root genie < genie-ddl/src/main/sql/mysql/schema.mysql.sql
script: ./gradle/buildViaTravis.sh
after_success:
- bash <(curl -s https://codecov.io/bash)
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
Expand Down
10 changes: 7 additions & 3 deletions README.md
Expand Up @@ -25,9 +25,13 @@ on the [releases](https://netflix.github.io/genie/releases/) page. Click on the

Genie builds are run on Travis CI [here](https://travis-ci.org/Netflix/genie).

| Branch | Build | Coverage |
|:-------:|:-------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Master | [![Build Status](https://travis-ci.org/Netflix/genie.svg?branch=master)](https://travis-ci.org/Netflix/genie) | [![Coverage Status](https://coveralls.io/repos/github/Netflix/genie/badge.svg?branch=master)](https://coveralls.io/github/Netflix/genie?branch=master) |
| Branch | Build | Coverage (coveralls.io) | Coverage (codecov.io) |
|:------:|:-------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------:|
| master | [![Build Status](https://travis-ci.org/Netflix/genie.svg?branch=master)](https://travis-ci.org/Netflix/genie) | [![Coverage Status](https://coveralls.io/repos/github/Netflix/genie/badge.svg?branch=master)](https://coveralls.io/github/Netflix/genie?branch=master) | [![codecov](https://codecov.io/gh/Netflix/genie/branch/master/graph/badge.svg)](https://codecov.io/gh/Netflix/genie/branch/master) |
| 3.3.x | [![Build Status](https://travis-ci.org/Netflix/genie.svg?branch=3.3.x)](https://travis-ci.org/Netflix/genie) | [![Coverage Status](https://coveralls.io/repos/github/Netflix/genie/badge.svg?branch=3.3.x)](https://coveralls.io/github/Netflix/genie?branch=3.3.x) | [![codecov](https://codecov.io/gh/Netflix/genie/branch/3.3.x/graph/badge.svg)](https://codecov.io/gh/Netflix/genie/branch/3.3.x) |
| 3.2.x | [![Build Status](https://travis-ci.org/Netflix/genie.svg?branch=3.2.x)](https://travis-ci.org/Netflix/genie) | [![Coverage Status](https://coveralls.io/repos/github/Netflix/genie/badge.svg?branch=3.2.x)](https://coveralls.io/github/Netflix/genie?branch=3.2.x) | [![codecov](https://codecov.io/gh/Netflix/genie/branch/3.2.x/graph/badge.svg)](https://codecov.io/gh/Netflix/genie/branch/3.2.x) |
| 3.1.x | [![Build Status](https://travis-ci.org/Netflix/genie.svg?branch=3.1.x)](https://travis-ci.org/Netflix/genie) | [![Coverage Status](https://coveralls.io/repos/github/Netflix/genie/badge.svg?branch=3.1.x)](https://coveralls.io/github/Netflix/genie?branch=3.1.x) | [![codecov](https://codecov.io/gh/Netflix/genie/branch/3.1.x/graph/badge.svg)](https://codecov.io/gh/Netflix/genie/branch/3.1.x) |
| 3.0.x | [![Build Status](https://travis-ci.org/Netflix/genie.svg?branch=3.0.x)](https://travis-ci.org/Netflix/genie) | [![Coverage Status](https://coveralls.io/repos/github/Netflix/genie/badge.svg?branch=3.0.x)](https://coveralls.io/github/Netflix/genie?branch=3.0.x) | [![codecov](https://codecov.io/gh/Netflix/genie/branch/3.0.x/graph/badge.svg)](https://codecov.io/gh/Netflix/genie/branch/3.0.x) |

## Docker

Expand Down
51 changes: 26 additions & 25 deletions build.gradle
Expand Up @@ -236,50 +236,51 @@ configure(javaProjects) {
}
}

task jacocoRootReport(type: JacocoReport, group: "Coverage reports") {
group = "Coverage Reports"
dependsOn javaProjects.test
additionalSourceDirs = files(javaProjects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(javaProjects.sourceSets.main.allSource.srcDirs)
classDirectories = files(javaProjects.sourceSets.main.output)
executionData = files(javaProjects.jacocoTestReport.executionData)
/**********************************
* Coverage Tasks
**********************************/

task codeCoverageReport(type: JacocoReport, group: "Coverage reports") {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")

dependsOn javaProjects*.test

javaProjects.each {
sourceSets it.sourceSets.main
}

reports {
html.enabled = true
xml.enabled = true
}
onlyIf = {
true
}
doFirst {
executionData = files(
executionData.findAll {
it.exists()
}
)
xml.destination new File("${buildDir}/reports/jacoco/report.xml")
html.enabled = true
html.destination new File("${buildDir}/reports/jacoco/html")
csv.enabled = false
}
afterEvaluate {
// Exclude generated files from top-level coverage report
classDirectories = files(
classDirectories.files.collect {
fileTree(dir: it, exclude: ["com/netflix/genie/core/jpa/entities/*_*"])
fileTree(
dir: it,
exclude: [
"**/com/netflix/genie/core/jpa/entities/*_*",
]
)
}
)
}
}

/**********************************
* Coverage Tasks
**********************************/

coveralls {
sourceDirs = javaProjects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${project.buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
jacocoReportPath = "${project.buildDir}/reports/jacoco/report.xml"
}

tasks.coveralls {
group = "Coverage reports"
description = "Uploads the aggregated coverage report to Coveralls"

dependsOn jacocoRootReport
dependsOn codeCoverageReport
onlyIf {
System.env."CI"
}
Expand Down
10 changes: 5 additions & 5 deletions gradle/buildViaTravis.sh
Expand Up @@ -3,21 +3,21 @@

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew --no-daemon build asciidoc coveralls dockerBuildAllImages
./gradlew --no-daemon build asciidoc codeCoverageReport coveralls dockerBuildAllImages
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
./gradlew --no-daemon -Prelease.travisBranch=$TRAVIS_BRANCH -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" snapshot coveralls publishGhPages dockerPush
./gradlew --no-daemon -Prelease.travisBranch=$TRAVIS_BRANCH -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" snapshot codeCoverageReport coveralls publishGhPages dockerPush
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
case "$TRAVIS_TAG" in
*-rc\.*)
./gradlew --no-daemon -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" candidate coveralls publishGhPages dockerPush
./gradlew --no-daemon -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" candidate codeCoverageReport coveralls publishGhPages dockerPush
;;
*)
./gradlew --no-daemon -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" final coveralls publishGhPages dockerPush
./gradlew --no-daemon -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" final codeCoverageReport coveralls publishGhPages dockerPush
;;
esac
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
./gradlew --no-daemon build coveralls
./gradlew --no-daemon build codeCoverageReport coveralls
fi

0 comments on commit c5f9499

Please sign in to comment.