From 0d9ec4f1977cec89305087d5e79d4b697e73eeb5 Mon Sep 17 00:00:00 2001 From: John Niang Date: Fri, 24 Feb 2023 15:51:21 +0800 Subject: [PATCH] Report test result using Jacoco plugin (#3385) --- .github/workflows/halo.yaml | 2 ++ README.md | 1 + build.gradle | 12 ++++++++++++ 3 files changed, 15 insertions(+) diff --git a/.github/workflows/halo.yaml b/.github/workflows/halo.yaml index 64f797d51..d69b740a5 100644 --- a/.github/workflows/halo.yaml +++ b/.github/workflows/halo.yaml @@ -49,6 +49,8 @@ jobs: java-version: 17 - name: Run tests run: ./gradlew test + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 docker-build-and-push: runs-on: ubuntu-latest needs: test diff --git a/README.md b/README.md index b225bccfa..03b26042c 100755 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Docker pulls GitHub last commit GitHub Workflow Status +Codecov percentage
官网 文档 diff --git a/build.gradle b/build.gradle index 7fc1898d9..373ebd062 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,7 @@ plugins { id "com.gorylenko.gradle-git-properties" version "2.3.2" id "checkstyle" id 'java' + id 'jacoco' } group = "run.halo.app" @@ -115,3 +116,14 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +test { + finalizedBy jacocoTestReport +} + +jacocoTestReport { + reports { + xml.enabled true + html.enabled false + } +}