From 4dbfdf2ea3f9c218728a9c5b6b1b3441f82eb43a Mon Sep 17 00:00:00 2001 From: qianmoQ Date: Tue, 4 Feb 2025 09:24:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=8E=AF=E5=A2=83):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/checker.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/checker.yml b/.github/workflows/checker.yml index ad0f38b..716845e 100644 --- a/.github/workflows/checker.yml +++ b/.github/workflows/checker.yml @@ -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