From 44bce493ac493348e4b9869b6655d1591984c192 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 28 Dec 2025 01:12:08 -0800 Subject: [PATCH] Add JUnit reporter integration and update workflow steps --- .github/workflows/bld.yml | 45 +++++++++++++++++++++++++++++---- lib/bld/bld-wrapper.properties | 1 + src/bld/java/rife/BldBuild.java | 9 +++++++ 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml index 1446b0a..66a1cc5 100644 --- a/.github/workflows/bld.yml +++ b/.github/workflows/bld.yml @@ -2,6 +2,9 @@ name: bld-ci on: [push, pull_request, workflow_dispatch] +env: + REPORTS_DIR: "build/test-results/test/" + jobs: build-linux: runs-on: ubuntu-latest @@ -104,12 +107,24 @@ jobs: java-version: ${{ matrix.java-version }} check-latest: true + - name: Download dependencies + run: ./bld clean download + + - name: Compile source + run: ./bld compile + - name: Run tests + id: tests run: >- - ./bld clean download compile test + ./bld test -Dtest.postgres=true -Dtest.mysql=true -Dtest.mariadb=true -Dtest.oracle=true -Dtest.oracle-free=true -DtestsBadgeUrl=https://rife2.com/tests-badge/update/com.uwyn.rife2/bld -DtestsBadgeApiKey=${{ secrets.TESTS_BADGE_API_KEY }} + --reports-dir=${{ env.REPORTS_DIR }} + + - name: Run reporter + if: always() && steps.tests.outcome == 'failure' + run: ./bld reporter --all build-macos: runs-on: macos-latest @@ -133,9 +148,19 @@ jobs: java-version: ${{ matrix.java-version }} check-latest: true + - name: Download dependencies + run: ./bld clean download + + - name: Compile source + run: ./bld compile + - name: Run tests - run: >- - ./bld clean download compile test + id: tests + run: ./bld test --reports-dir=${{ env.REPORTS_DIR }} + + - name: Run reporter + if: always() && steps.tests.outcome == 'failure' + run: ./bld reporter --all build-windows: runs-on: windows-latest @@ -162,6 +187,16 @@ jobs: java-version: ${{ matrix.java-version }} check-latest: true + - name: Download dependencies + run: .\bld.bat clean download + + - name: Compile source + run: .\bld.bat compile + - name: Run tests - run: >- - .\bld.bat clean download compile test + id: tests + run: .\bld.bat test --reports-dir=${{ env.REPORTS_DIR }} + + - name: Run reporter + if: always() && steps.tests.outcome == 'failure' + run: .\bld.bat reporter --all diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties index 21bd7dd..3d1879e 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -3,6 +3,7 @@ bld.downloadExtensionSources=true bld.downloadLocation= bld.extension-antlr=com.uwyn.rife2:bld-antlr4:1.4.3 bld.extension-archive=com.uwyn.rife2:bld-archive:0.6.3 +bld.extension-reporter=com.uwyn.rife2:bld-junit-reporter:0.9.2 bld.extension-tests=com.uwyn.rife2:bld-tests-badge:1.6.3 bld.javaOptions= bld.javacOptions= diff --git a/src/bld/java/rife/BldBuild.java b/src/bld/java/rife/BldBuild.java index 538ae68..d3875e7 100644 --- a/src/bld/java/rife/BldBuild.java +++ b/src/bld/java/rife/BldBuild.java @@ -7,6 +7,7 @@ package rife; import rife.bld.BuildCommand; import rife.bld.Cli; import rife.bld.dependencies.VersionNumber; +import rife.bld.extension.JUnitReporterOperation; import rife.bld.extension.ZipOperation; import rife.bld.operations.*; import rife.bld.publish.*; @@ -161,6 +162,14 @@ public class BldBuild extends AbstractRife2Build { zipBld(); } + @BuildCommand(summary = "Runs the JUnit reporter") + public void reporter() throws Exception { + new JUnitReporterOperation() + .fromProject(this) + .failOnSummary(true) + .execute(); + } + public void publish() throws Exception { all();