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 + } +}