Add JUnit reporter integration and update workflow steps

This commit is contained in:
Erik C. Thauvin 2025-12-28 01:12:08 -08:00
parent 1a1e97d0c4
commit 44bce493ac
No known key found for this signature in database
GPG key ID: 776702A6A2DA330E
3 changed files with 50 additions and 5 deletions

View file

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

View file

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

View file

@ -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();