From 9240ae81db4c8148ca36212ef684c12d70bb65cd Mon Sep 17 00:00:00 2001 From: Nghia Tran Date: Fri, 18 Sep 2020 15:12:29 -0700 Subject: [PATCH] Add CodeCov GitHub action and badge. (#339) * Add CodeCov GitHub action and badge. * Change comment behavior and exclude sdk-tests. --- .codecov.yaml | 6 ++++++ .github/workflows/build.yml | 8 +++++--- README.md | 5 +++-- pom.xml | 24 ++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 .codecov.yaml diff --git a/.codecov.yaml b/.codecov.yaml new file mode 100644 index 000000000..7f0b71a56 --- /dev/null +++ b/.codecov.yaml @@ -0,0 +1,6 @@ +ignore: + - examples + - sdk-tests +comment: + # Delete old comment and post new one for new coverage information. + behavior: new diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94ddba838..fd9244c0a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,15 +1,15 @@ name: Build -on: +on: push: branches: - master - release-* tags: - v* - + pull_request: - branches: + branches: - master - release-* @@ -98,6 +98,8 @@ jobs: run: mvn compile -q - name: Unit tests run: mvn test -q + - name: Codecov + uses: codecov/codecov-action@v1 - name: Install jars run: mvn install -q - name: Integration tests diff --git a/README.md b/README.md index b5c3c1b9e..5c9122f28 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://github.com/dapr/java-sdk/workflows/Build/badge.svg?event=push&branch=master)](https://github.com/dapr/java-sdk/actions?workflow=Build) [![Gitter](https://badges.gitter.im/Dapr/java-sdk.svg)](https://gitter.im/Dapr/java-sdk?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +[![codecov](https://codecov.io/gh/dapr/java-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/dapr/java-sdk) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) This is the Dapr SDK for Java, including the following features: @@ -92,13 +93,13 @@ For a Gradle project, add the following to your `build.gradle` file: repositories { ... // Dapr repositories - maven { + maven { url "https://oss.sonatype.org/content/repositories/snapshots" mavenContent { snapshotsOnly() } } - maven { + maven { url "https://oss.sonatype.org/service/local/staging/deploy/maven2/" } } diff --git a/pom.xml b/pom.xml index 42f3e14d8..c292c73f7 100644 --- a/pom.xml +++ b/pom.xml @@ -76,6 +76,25 @@ + + org.jacoco + jacoco-maven-plugin + 0.8.6 + + + + prepare-agent + + + + report + test + + report + + + + org.apache.maven.plugins maven-gpg-plugin @@ -191,6 +210,11 @@ + + org.codehaus.mojo + cobertura-maven-plugin + 2.7 + org.apache.maven.plugins maven-project-info-reports-plugin