Report test result using Jacoco plugin (#3385)

pull/3388/head^2
John Niang 2023-02-24 15:51:21 +08:00 committed by GitHub
parent 7a0ba922af
commit 0d9ec4f197
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View File

@ -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

View File

@ -11,6 +11,7 @@
<a href="https://hub.docker.com/r/halohub/halo"><img alt="Docker pulls" src="https://img.shields.io/docker/pulls/halohub/halo?style=flat-square" /></a>
<a href="https://github.com/halo-dev/halo/commits"><img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/halo-dev/halo.svg?style=flat-square" /></a>
<a href="https://github.com/halo-dev/halo/actions"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/halo-dev/halo/halo.yaml?branch=main&style=flat-square" /></a>
<a href="https://codecov.io/gh/halo-dev/halo"><img alt="Codecov percentage" src="https://img.shields.io/codecov/c/github/halo-dev/halo/main?style=flat-square&token=YsRUg9fall"/></a>
<br />
<a href="https://halo.run">官网</a>
<a href="https://docs.halo.run">文档</a>

View File

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