Skip to content

Commit

Permalink
feat(环境): 添加单元测试 CI
Browse files Browse the repository at this point in the history
  • Loading branch information
qianmoQ committed Feb 4, 2025
1 parent edde5f2 commit 4dbfdf2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,27 @@ jobs:
- name: Check Spotbugs
run: ./mvnw spotbugs:check

# 添加单元测试步骤
- name: Run Unit Tests
run: ./mvnw -B test

# 生成测试覆盖率报告
- name: Generate Test Coverage Report
run: ./mvnw -B verify jacoco:report

- name: Build with Maven
run: ./mvnw -B clean package

# 使用 actions/test-reporter 展示测试结果
- name: Publish Test Results
uses: dorny/test-reporter@v1
if: always()
with:
name: JUnit Tests (${{ matrix.java }})
path: target/surefire-reports/*.xml
reporter: java-junit
fail-on-error: true

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 4dbfdf2

Please sign in to comment.