diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml index 1446b0a..01b8fa2 100644 --- a/.github/workflows/bld.yml +++ b/.github/workflows/bld.yml @@ -104,13 +104,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 }} + - name: Run reporter + if: always() && steps.tests.outcome == 'failure' + run: ./bld reporter --all + build-macos: runs-on: macos-latest @@ -133,9 +144,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 + + - name: Run reporter + if: always() && steps.tests.outcome == 'failure' + run: ./bld reporter --all build-windows: runs-on: windows-latest @@ -162,6 +183,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 + + - 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..0631409 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -3,9 +3,10 @@ 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-SNAPSHOT bld.extension-tests=com.uwyn.rife2:bld-tests-badge:1.6.3 bld.javaOptions= bld.javacOptions= -bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES +bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES,RIFE2_SNAPSHOTS bld.sourceDirectories=core/src/bld/java bld.version=2.3.0 \ No newline at end of file diff --git a/src/bld/java/rife/BldBuild.java b/src/bld/java/rife/BldBuild.java index 538ae68..76bebfb 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.*; @@ -110,6 +111,8 @@ public class BldBuild extends AbstractRife2Build { .signPassphrase(property("sign.passphrase"))) .artifacts( new PublishArtifact(zipBldOperation.destinationFile(), "", "zip")); + + testOperation().testToolOptions().reportsDir(new File("build/test-results/test/")); } final ZipOperation zipBldOperation = new ZipOperation(); @@ -161,6 +164,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();