From 4f63e55b514cea7c01a713dce19a6da3e56e2725 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Thu, 10 Oct 2024 15:30:37 +0100 Subject: [PATCH 01/25] test --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +test From 4b41cf34132fa8ded1f1e73ec3cddd300a15f63d Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 12:55:20 +0000 Subject: [PATCH 02/25] test --- .github/workflows/maven_test_artifact.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/maven_test_artifact.yml b/.github/workflows/maven_test_artifact.yml index 2a6bc09..fe576eb 100644 --- a/.github/workflows/maven_test_artifact.yml +++ b/.github/workflows/maven_test_artifact.yml @@ -115,6 +115,8 @@ jobs: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ --projects=${{ inputs.project }} + echo "::error file=app.js,line=1,col=5,endColumn=7,title=YOUR-TITLE::Missing semicolon" + - uses: actions/upload-artifact@v3 # upload test results if: success() || failure() # run this step even if previous step failed with: From 45aa56803b26de7d6a405fb91a1bfed0a0818b99 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 15:29:11 +0000 Subject: [PATCH 03/25] publish pr --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c243064..9c4c32a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -17,8 +17,8 @@ concurrency: cancel-in-progress: true jobs: - unit_tests_artifact: - uses: ./.github/workflows/unit_tests_artifact.yml + unit_tests_publish: + uses: ./.github/workflows/unit_tests_publish.yml with: seed_maven_cache: true install_maven_dependencies: true From d7f205dcd9ba85051df92a6cd95470a2e2d9c321 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 15:32:46 +0000 Subject: [PATCH 04/25] test --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9daeafb..8405060 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ + test From 64cc1b9236e9577c7eff6724310fcf36808dfe0c Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 15:34:57 +0000 Subject: [PATCH 05/25] test no fail on error --- .github/workflows/maven_test_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index dc97643..6e09d72 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -123,5 +123,5 @@ jobs: name: "maven_test_publish_${{ inputs.project }}" path: ${{ inputs.project }}/target/surefire-reports/*.xml reporter: java-junit - fail-on-error: true + fail-on-error: false From b97dc74ee5b660e8be82fd453f8ecee3227adf02 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 15:43:33 +0000 Subject: [PATCH 06/25] new reporter --- .github/workflows/maven_test_publish.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 6e09d72..18959fd 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -116,12 +116,19 @@ jobs: --projects=${{ inputs.project }} # NOTE: if the above test fail then this step will report that failure and stop the run +# - name: Publish Unit Test Results +# uses: dorny/test-reporter@e9fa2f582c0ebbe2e263fd18fad744d52e0b0203 +# if: always() +# with: +# name: "maven_test_publish_${{ inputs.project }}" +# path: ${{ inputs.project }}/target/surefire-reports/*.xml +# reporter: java-junit +# fail-on-error: false +# - name: Publish Unit Test Results - uses: dorny/test-reporter@e9fa2f582c0ebbe2e263fd18fad744d52e0b0203 + uses: scacap/action-surefire-report@v1.8.0 if: always() with: - name: "maven_test_publish_${{ inputs.project }}" - path: ${{ inputs.project }}/target/surefire-reports/*.xml - reporter: java-junit - fail-on-error: false + report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml + From 9d166ad6c559f5a01b22e1faf08b17a53d7c88a0 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 15:45:50 +0000 Subject: [PATCH 07/25] new reporter --- .github/workflows/maven_test_publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 18959fd..2943a3f 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -130,5 +130,8 @@ jobs: if: always() with: report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml + create_check: false + fail_on_test_failures: true + file_name_in_stack_trace: true From ab36d5696125f5ce115129be86a4f44ba22cc214 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 15:52:21 +0000 Subject: [PATCH 08/25] try fail at end --- .github/workflows/maven_test_publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 2943a3f..21013ba 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -111,9 +111,9 @@ jobs: ######################################################################################## - name: "Test ${{ inputs.project }}" run: | - mvn -T 1C --batch-mode -Dmaven.test.failure.ignore=true test \ + mvn -T 1C --batch-mode test \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --projects=${{ inputs.project }} + --projects=${{ inputs.project }} --fail-at-end # NOTE: if the above test fail then this step will report that failure and stop the run # - name: Publish Unit Test Results From 7730f30d92e5b36a39a4fb7727d925541f5ab764 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 15:53:23 +0000 Subject: [PATCH 09/25] test --- .github/workflows/maven_test_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 21013ba..4225bad 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -131,7 +131,7 @@ jobs: with: report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml create_check: false - fail_on_test_failures: true + fail_on_test_failures: false file_name_in_stack_trace: true From 8d1a88c240be4579fcdaa848e71037d84df9da5a Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 15:58:26 +0000 Subject: [PATCH 10/25] test --- .github/workflows/maven_test_publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 4225bad..8be5f9b 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -127,11 +127,12 @@ jobs: # - name: Publish Unit Test Results uses: scacap/action-surefire-report@v1.8.0 - if: always() + if: failure() # only report if a test has failed with: report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml create_check: false fail_on_test_failures: false file_name_in_stack_trace: true + skip_publishing: true From 82abc2859fa96fa866685362ddaeabeb31b84670 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 16:02:11 +0000 Subject: [PATCH 11/25] test --- .github/workflows/maven_test_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 8be5f9b..33505ac 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -133,6 +133,6 @@ jobs: create_check: false fail_on_test_failures: false file_name_in_stack_trace: true - skip_publishing: true + skip_publishing: false From acb07041e3ab15ddd27a2ea1d3ef571e53df434b Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 16:05:40 +0000 Subject: [PATCH 12/25] test --- .github/workflows/maven_test_publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 33505ac..4981e27 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -134,5 +134,6 @@ jobs: fail_on_test_failures: false file_name_in_stack_trace: true skip_publishing: false + fail_if_no_tests: false From 7ec2338b1a4ad7b5126740da5b570385d834cd02 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 16:10:07 +0000 Subject: [PATCH 13/25] test --- .github/workflows/maven_test_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 4981e27..5234123 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -130,7 +130,7 @@ jobs: if: failure() # only report if a test has failed with: report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml - create_check: false + create_check: true fail_on_test_failures: false file_name_in_stack_trace: true skip_publishing: false From 53834a1eeb10740fa7f7de2a55b6c8112fa529fa Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 16:57:11 +0000 Subject: [PATCH 14/25] new check plugin --- .github/workflows/maven_test_publish.yml | 21 +++++++++++++------ .../test/java/com/example/HelloWorldTest.java | 8 +++++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 5234123..059952a 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -125,15 +125,24 @@ jobs: # reporter: java-junit # fail-on-error: false # +# - name: Publish Unit Test Results +# uses: scacap/action-surefire-report@v1.8.0 +# if: failure() # only report if a test has failed +# with: +# report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml +# create_check: true +# fail_on_test_failures: false +# file_name_in_stack_trace: true +# skip_publishing: false +# fail_if_no_tests: false + - name: Publish Unit Test Results - uses: scacap/action-surefire-report@v1.8.0 + uses: mikepenz/action-junit-report@v5 if: failure() # only report if a test has failed with: report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml - create_check: true - fail_on_test_failures: false - file_name_in_stack_trace: true - skip_publishing: false - fail_if_no_tests: false + annotate_only: true + + diff --git a/hello_world/src/test/java/com/example/HelloWorldTest.java b/hello_world/src/test/java/com/example/HelloWorldTest.java index fa04d7d..1802e10 100644 --- a/hello_world/src/test/java/com/example/HelloWorldTest.java +++ b/hello_world/src/test/java/com/example/HelloWorldTest.java @@ -17,4 +17,12 @@ public void testFailingAssertion() { // This assertion will fail assertTrue(false, "This is a failing test to test the pipeline."); } + + @Test + public void testFailingAssertionMore() { + // This assertion will fail + assertTrue(false, "This is also failing test to test the pipeline."); + } + + } From 40b7263a89817f511139f8c0c02ed1d6eac7fda2 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 16:58:30 +0000 Subject: [PATCH 15/25] new check plugin --- .github/workflows/maven_test_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 059952a..a10311b 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -141,7 +141,7 @@ jobs: if: failure() # only report if a test has failed with: report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml - annotate_only: true + annotate_only: false From 49c283a9c9a7fb7594fadeec277976b9c5d2dee7 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 17:03:44 +0000 Subject: [PATCH 16/25] new check plugin --- .github/workflows/maven_test_publish.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index a10311b..1938bf5 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -136,13 +136,25 @@ jobs: # skip_publishing: false # fail_if_no_tests: false - - name: Publish Unit Test Results + - name: Publish Unit Test Results non forked repo uses: mikepenz/action-junit-report@v5 - if: failure() # only report if a test has failed + if: failure() and ${{ github.event.pull_request.head.repo.full_name == github.repository }} # only report if a test has failed and we are a non forked repo with: + check_name: Unit Test Report ${{ inputs.project }} report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml annotate_only: false + - name: Publish Unit Test Results forked repo + uses: mikepenz/action-junit-report@v5 + if: failure() and ${{ github.event.pull_request.head.repo.full_name != github.repository }} # only report if a test has failed and we are a forked repo + with: + report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml + annotate_only: true # forked repo cannot write to checks + + + + + From dabee4e3461e8ace05af2b517bc79b5fcaffadc9 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 17:06:27 +0000 Subject: [PATCH 17/25] new check plugin --- .github/workflows/maven_test_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 1938bf5..5b3b96b 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -136,7 +136,7 @@ jobs: # skip_publishing: false # fail_if_no_tests: false - - name: Publish Unit Test Results non forked repo + - name: Publish Unit Test Results non forked repo ${{ github.repository }} uses: mikepenz/action-junit-report@v5 if: failure() and ${{ github.event.pull_request.head.repo.full_name == github.repository }} # only report if a test has failed and we are a non forked repo with: From 0229ae62b0eb006eb6a22cab7d4999a608f03e36 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 17:07:39 +0000 Subject: [PATCH 18/25] new check plugin --- .github/workflows/maven_test_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 5b3b96b..a9ce0e4 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -136,7 +136,7 @@ jobs: # skip_publishing: false # fail_if_no_tests: false - - name: Publish Unit Test Results non forked repo ${{ github.repository }} + - name: Publish Unit Test Results non forked repo ${{ github.event.pull_request.head.repo.full_name }} equals ${{ github.repository }} uses: mikepenz/action-junit-report@v5 if: failure() and ${{ github.event.pull_request.head.repo.full_name == github.repository }} # only report if a test has failed and we are a non forked repo with: From d31a09706de17ebcb669e13f1a7685c985d7c383 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 17:09:58 +0000 Subject: [PATCH 19/25] new check plugin --- .github/workflows/maven_test_publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index a9ce0e4..b55ef32 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -136,9 +136,9 @@ jobs: # skip_publishing: false # fail_if_no_tests: false - - name: Publish Unit Test Results non forked repo ${{ github.event.pull_request.head.repo.full_name }} equals ${{ github.repository }} + - name: Publish Unit Test Results non forked repo uses: mikepenz/action-junit-report@v5 - if: failure() and ${{ github.event.pull_request.head.repo.full_name == github.repository }} # only report if a test has failed and we are a non forked repo + if: failure() && ${{ github.event.pull_request.head.repo.full_name == github.repository }} # only report if a test has failed and we are a non forked repo with: check_name: Unit Test Report ${{ inputs.project }} report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml @@ -146,7 +146,7 @@ jobs: - name: Publish Unit Test Results forked repo uses: mikepenz/action-junit-report@v5 - if: failure() and ${{ github.event.pull_request.head.repo.full_name != github.repository }} # only report if a test has failed and we are a forked repo + if: failure() && ${{ github.event.pull_request.head.repo.full_name != github.repository }} # only report if a test has failed and we are a forked repo with: report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml annotate_only: true # forked repo cannot write to checks From 4abf4347834be15413e8cb10358bc9a2fe7c7f80 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 17:12:26 +0000 Subject: [PATCH 20/25] new check plugin --- .github/workflows/maven_test_publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index b55ef32..1a67328 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -138,7 +138,7 @@ jobs: - name: Publish Unit Test Results non forked repo uses: mikepenz/action-junit-report@v5 - if: failure() && ${{ github.event.pull_request.head.repo.full_name == github.repository }} # only report if a test has failed and we are a non forked repo + if: ${{ failure() && (github.event.pull_request.head.repo.full_name == github.repository) }} # only report if a test has failed and we are a non forked repo with: check_name: Unit Test Report ${{ inputs.project }} report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml @@ -146,7 +146,7 @@ jobs: - name: Publish Unit Test Results forked repo uses: mikepenz/action-junit-report@v5 - if: failure() && ${{ github.event.pull_request.head.repo.full_name != github.repository }} # only report if a test has failed and we are a forked repo + if: ${{ failure() && (github.event.pull_request.head.repo.full_name != github.repository) }} # only report if a test has failed and we are a forked repo with: report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml annotate_only: true # forked repo cannot write to checks From 8b1115ada7c2a62f65165dbf50e43e9396e0db54 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 17:15:07 +0000 Subject: [PATCH 21/25] new check plugin --- .github/workflows/maven_test_publish.yml | 35 ++++++++++++------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 1a67328..78edfde 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -115,16 +115,15 @@ jobs: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ --projects=${{ inputs.project }} --fail-at-end - # NOTE: if the above test fail then this step will report that failure and stop the run -# - name: Publish Unit Test Results -# uses: dorny/test-reporter@e9fa2f582c0ebbe2e263fd18fad744d52e0b0203 -# if: always() -# with: -# name: "maven_test_publish_${{ inputs.project }}" -# path: ${{ inputs.project }}/target/surefire-reports/*.xml -# reporter: java-junit -# fail-on-error: false -# + - name: Publish Unit Test Results + if: ${{ failure() && (github.event.pull_request.head.repo.full_name == github.repository) }} # only report if a test has failed and we are a non forked repo + uses: dorny/test-reporter@e9fa2f582c0ebbe2e263fd18fad744d52e0b0203 + with: + name: "maven_test_publish_${{ inputs.project }}" + path: ${{ inputs.project }}/target/surefire-reports/*.xml + reporter: java-junit + fail-on-error: false + # - name: Publish Unit Test Results # uses: scacap/action-surefire-report@v1.8.0 # if: failure() # only report if a test has failed @@ -136,14 +135,14 @@ jobs: # skip_publishing: false # fail_if_no_tests: false - - name: Publish Unit Test Results non forked repo - uses: mikepenz/action-junit-report@v5 - if: ${{ failure() && (github.event.pull_request.head.repo.full_name == github.repository) }} # only report if a test has failed and we are a non forked repo - with: - check_name: Unit Test Report ${{ inputs.project }} - report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml - annotate_only: false - +# - name: Publish Unit Test Results non forked repo +# uses: mikepenz/action-junit-report@v5 +# if: ${{ failure() && (github.event.pull_request.head.repo.full_name == github.repository) }} # only report if a test has failed and we are a non forked repo +# with: +# check_name: Unit Test Report ${{ inputs.project }} +# report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml +# annotate_only: false +# - name: Publish Unit Test Results forked repo uses: mikepenz/action-junit-report@v5 if: ${{ failure() && (github.event.pull_request.head.repo.full_name != github.repository) }} # only report if a test has failed and we are a forked repo From a05bcf33f8136b5355d69dea6d55718bca3f0f24 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 17:17:41 +0000 Subject: [PATCH 22/25] test --- .github/workflows/maven_test_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/maven_test_publish.yml index 78edfde..aa8205b 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/maven_test_publish.yml @@ -122,7 +122,7 @@ jobs: name: "maven_test_publish_${{ inputs.project }}" path: ${{ inputs.project }}/target/surefire-reports/*.xml reporter: java-junit - fail-on-error: false + fail-on-error: true # - name: Publish Unit Test Results # uses: scacap/action-surefire-report@v1.8.0 From df3e0283db621652dc8510d72b4a2453ccbfda2d Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 18:27:08 +0000 Subject: [PATCH 23/25] matrix --- .github/workflows/maven_test_artifact.yml | 124 ------------------ .github/workflows/maven_test_report.yml | 30 ----- .../{maven_test_publish.yml => mvn_test.yml} | 55 +++----- .github/workflows/pr.yml | 4 +- .github/workflows/pr_completed.yml | 32 ----- .github/workflows/unit_tests_artifact.yml | 73 ----------- .github/workflows/unit_tests_publish.yml | 74 ----------- .github/workflows/unit_tests_report.yml | 26 ---- 8 files changed, 19 insertions(+), 399 deletions(-) delete mode 100644 .github/workflows/maven_test_artifact.yml delete mode 100644 .github/workflows/maven_test_report.yml rename .github/workflows/{maven_test_publish.yml => mvn_test.yml} (72%) delete mode 100644 .github/workflows/pr_completed.yml delete mode 100644 .github/workflows/unit_tests_artifact.yml delete mode 100644 .github/workflows/unit_tests_publish.yml delete mode 100644 .github/workflows/unit_tests_report.yml diff --git a/.github/workflows/maven_test_artifact.yml b/.github/workflows/maven_test_artifact.yml deleted file mode 100644 index fe576eb..0000000 --- a/.github/workflows/maven_test_artifact.yml +++ /dev/null @@ -1,124 +0,0 @@ -name: maven_test_artifact - -# run maven tests and upload results as an artifact -# can be run from a pr - -permissions: - checks: write - contents: read - issues: read - pull-requests: write - -on: - workflow_call: - inputs: - project: - description: 'Name of the artifact env' - required: false - default: 'prod' - type: string - version_tag: - description: 'Name of the tag to build' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or none' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - - workflow_dispatch: - inputs: - project: - description: 'Name of the artifact env' - required: false - default: 'prod' - type: string - version_tag: - description: 'Name of the tag to build' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or none' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - - -jobs: - maven_test: - runs-on: ubuntu-latest - steps: - - name: git-checkout-ref-action - id: ref - uses: ORCID/git-checkout-ref-action@main - with: - default_branch: ${{ github.event.repository.default_branch }} - ref: ${{ inputs.ref }} - - - uses: actions/checkout@v3 - with: - ref: ${{ steps.ref.outputs.ref }} - # checkout some history so we can scan commits for bump messages - # NOTE: history does not include tags! - fetch-depth: 100 - - - name: find next version - id: version - uses: ORCID/version-bump-action@main - with: - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - - - name: Set up Open JDK 11 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '11' - -######################################################################################## - - name: "Test ${{ inputs.project }}" - run: | - mvn -T 1C --batch-mode -Dmaven.test.failure.ignore=true test \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --projects=${{ inputs.project }} - - echo "::error file=app.js,line=1,col=5,endColumn=7,title=YOUR-TITLE::Missing semicolon" - - - uses: actions/upload-artifact@v3 # upload test results - if: success() || failure() # run this step even if previous step failed - with: - name: ${{ inputs.project }} - path: ${{ inputs.project }}/target/surefire-reports/*.xml diff --git a/.github/workflows/maven_test_report.yml b/.github/workflows/maven_test_report.yml deleted file mode 100644 index e44b1f7..0000000 --- a/.github/workflows/maven_test_report.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: unit_test_report - -on: - workflow_call: - inputs: - project: - description: 'Name of the project in the repo' - required: false - default: "." - type: string - - workflow_dispatch: - inputs: - project: - description: 'Name of the project in the repo' - required: false - default: "." - type: string - -jobs: - report: - runs-on: ubuntu-latest - steps: - - uses: dorny/test-reporter@e9fa2f582c0ebbe2e263fd18fad744d52e0b0203 - with: - artifact: ${{ inputs.project }} - name: "maven_test_report_${{ inputs.project }}" # Name of the check run which will be created - path: '*.xml' # Path to test results (inside artifact .zip) - reporter: java-junit # Format of test results - diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/mvn_test.yml similarity index 72% rename from .github/workflows/maven_test_publish.yml rename to .github/workflows/mvn_test.yml index aa8205b..8512a79 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/mvn_test.yml @@ -1,7 +1,6 @@ -name: maven_test_publish +name: mvn_test # run maven tests and publish results in one step -# run from privileged branch permissions: checks: write @@ -78,7 +77,13 @@ on: jobs: - maven_test: + mvn_test: + + strategy: + matrix: + include: + - project: hello_world + runs-on: ubuntu-latest steps: - name: git-checkout-ref-action @@ -109,51 +114,25 @@ jobs: java-version: '11' ######################################################################################## - - name: "Test ${{ inputs.project }}" + - name: "Test ${{ matrix.project }}" run: | mvn -T 1C --batch-mode test \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --projects=${{ inputs.project }} --fail-at-end + --projects=${{ matrix.project }} --fail-at-end - - name: Publish Unit Test Results + - name: Publish Unit Test report for non forked repo if: ${{ failure() && (github.event.pull_request.head.repo.full_name == github.repository) }} # only report if a test has failed and we are a non forked repo uses: dorny/test-reporter@e9fa2f582c0ebbe2e263fd18fad744d52e0b0203 with: - name: "maven_test_publish_${{ inputs.project }}" - path: ${{ inputs.project }}/target/surefire-reports/*.xml + name: "Unit Test report for ${{ matrix.project }}" + path: ${{ matrix.project }}/target/surefire-reports/*.xml reporter: java-junit fail-on-error: true -# - name: Publish Unit Test Results -# uses: scacap/action-surefire-report@v1.8.0 -# if: failure() # only report if a test has failed -# with: -# report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml -# create_check: true -# fail_on_test_failures: false -# file_name_in_stack_trace: true -# skip_publishing: false -# fail_if_no_tests: false - -# - name: Publish Unit Test Results non forked repo -# uses: mikepenz/action-junit-report@v5 -# if: ${{ failure() && (github.event.pull_request.head.repo.full_name == github.repository) }} # only report if a test has failed and we are a non forked repo -# with: -# check_name: Unit Test Report ${{ inputs.project }} -# report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml -# annotate_only: false -# - - name: Publish Unit Test Results forked repo - uses: mikepenz/action-junit-report@v5 + - name: Publish Unit Test report for forked repo + uses: mikepenz/action-junit-report@ec3a351c13e080dc4fa94c49ab7ad5bf778a9668 # v5 if: ${{ failure() && (github.event.pull_request.head.repo.full_name != github.repository) }} # only report if a test has failed and we are a forked repo with: - report_paths: ${{ inputs.project }}/target/surefire-reports/*.xml - annotate_only: true # forked repo cannot write to checks - - - - - - - + report_paths: ${{ matrix.project }}/target/surefire-reports/*.xml + annotate_only: true # forked repo cannot write to checks so just do annotations diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9c4c32a..53f36d7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -17,8 +17,8 @@ concurrency: cancel-in-progress: true jobs: - unit_tests_publish: - uses: ./.github/workflows/unit_tests_publish.yml + mvn_test: + uses: ./.github/workflows/mvn_test.yml with: seed_maven_cache: true install_maven_dependencies: true diff --git a/.github/workflows/pr_completed.yml b/.github/workflows/pr_completed.yml deleted file mode 100644 index 3d007a3..0000000 --- a/.github/workflows/pr_completed.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: pr_completed - -# this is a privileged workflow that can run with secrets -# to perform actions on work carried out in the pull_request workflow - -on: - workflow_run: - workflows: - - pr - types: - - completed - - workflow_call: - inputs: - version_tag: - description: 'version tag to use(vx.x.x)' - required: false - default: "next_tag" - type: string - - workflow_dispatch: - inputs: - version_tag: - description: 'version tag to use(vx.x.x)' - required: false - default: "next_tag" - type: string - -jobs: - unit_tests_report: - uses: ./.github/workflows/unit_tests_report.yml - diff --git a/.github/workflows/unit_tests_artifact.yml b/.github/workflows/unit_tests_artifact.yml deleted file mode 100644 index 77d775c..0000000 --- a/.github/workflows/unit_tests_artifact.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: unit_tests_artifact - -# Run tests and upload the results as an artifact -# Can be run from a unprivileged pull_request action -# Reporting is done in the pr_completed.yml workflow - -on: - workflow_call: - inputs: - version_tag: - description: 'Name of the tag to build' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or none' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - - - workflow_dispatch: - inputs: - version_tag: - description: 'Name of the tag to build' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or none' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - -jobs: - tst_hw: - uses: ./.github/workflows/maven_test_artifact.yml - with: - project: hello_world - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - diff --git a/.github/workflows/unit_tests_publish.yml b/.github/workflows/unit_tests_publish.yml deleted file mode 100644 index b227776..0000000 --- a/.github/workflows/unit_tests_publish.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: unit_tests_publish - -# full unit tests with report publishing - -on: - workflow_call: - inputs: - version_tag: - description: 'Name of the tag to build' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or none' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - - - workflow_dispatch: - inputs: - version_tag: - description: 'Name of the tag to build' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or none' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - -jobs: - - - tst_hello_world: - uses: ./.github/workflows/maven_test_publish.yml - with: - project: hello_world - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} diff --git a/.github/workflows/unit_tests_report.yml b/.github/workflows/unit_tests_report.yml deleted file mode 100644 index 6d98244..0000000 --- a/.github/workflows/unit_tests_report.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: unit_tests_report - -on: - workflow_call: - inputs: - version_tag: - description: 'version tag to use(vx.x.x)' - required: false - default: latest - type: string - - workflow_dispatch: - inputs: - version_tag: - description: 'version tag to use(vx.x.x)' - required: false - default: latest - type: string - -jobs: - - tst_hello_world: - uses: ./.github/workflows/maven_test_report.yml - with: - project: hello_world - From 82a67efff6e12dc6298650327c62643b301449c4 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Tue, 5 Nov 2024 18:30:55 +0000 Subject: [PATCH 24/25] matrix --- .github/workflows/build_debug.yml | 6 +++--- .github/workflows/build_test_release.yml | 6 +++--- .github/workflows/build_test_release_tag.yml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_debug.yml b/.github/workflows/build_debug.yml index fd8f181..5c1f3ac 100644 --- a/.github/workflows/build_debug.yml +++ b/.github/workflows/build_debug.yml @@ -69,8 +69,8 @@ jobs: ############################################################################## - unit_tests_publish: - uses: ./.github/workflows/maven_test_publish.yml + mvn_test: + uses: ./.github/workflows/mvn_test.yml with: version_tag: ${{ inputs.version_tag }} bump: ${{ inputs.bump }} @@ -86,7 +86,7 @@ jobs: secrets: inherit # pass all secrets for uploading assets needs: - seed_maven_cache - - unit_tests_publish + - mvn_test permissions: checks: write contents: read diff --git a/.github/workflows/build_test_release.yml b/.github/workflows/build_test_release.yml index 8b7ef2b..be2054b 100644 --- a/.github/workflows/build_test_release.yml +++ b/.github/workflows/build_test_release.yml @@ -70,8 +70,8 @@ jobs: needs: - seed_maven_cache - unit_tests_publish: - uses: ./.github/workflows/unit_tests_publish.yml + mvn_test: + uses: ./.github/workflows/mvn_test.yml with: version_tag: ${{ inputs.version_tag }} bump: ${{ inputs.bump }} @@ -88,7 +88,7 @@ jobs: secrets: inherit # pass all secrets for uploading assets needs: - lint - - unit_tests_publish + - mvn_test - install_maven_dependencies permissions: checks: write diff --git a/.github/workflows/build_test_release_tag.yml b/.github/workflows/build_test_release_tag.yml index 8428f7d..fb48088 100644 --- a/.github/workflows/build_test_release_tag.yml +++ b/.github/workflows/build_test_release_tag.yml @@ -54,8 +54,8 @@ jobs: lint: uses: ./.github/workflows/lint.yml - unit_tests_publish: - uses: ./.github/workflows/unit_tests_publish.yml + mvn_test: + uses: ./.github/workflows/mvn_test.yml with: version_tag: ${{ inputs.version_tag }} bump: ${{ inputs.bump }} @@ -70,7 +70,7 @@ jobs: secrets: inherit # pass all secrets for uploading assets needs: - lint - - unit_tests_publish + - mvn_test permissions: checks: write contents: read From b10ce4f8846efd00ce1a6845b41a2e64cb95d65c Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Wed, 6 Nov 2024 11:45:36 +0000 Subject: [PATCH 25/25] cleanup output --- .github/workflows/mvn_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mvn_test.yml b/.github/workflows/mvn_test.yml index 8512a79..846f8e4 100644 --- a/.github/workflows/mvn_test.yml +++ b/.github/workflows/mvn_test.yml @@ -120,16 +120,16 @@ jobs: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ --projects=${{ matrix.project }} --fail-at-end - - name: Publish Unit Test report for non forked repo + - name: Publish unit test report for non forked repo if: ${{ failure() && (github.event.pull_request.head.repo.full_name == github.repository) }} # only report if a test has failed and we are a non forked repo uses: dorny/test-reporter@e9fa2f582c0ebbe2e263fd18fad744d52e0b0203 with: - name: "Unit Test report for ${{ matrix.project }}" + name: "Unit test report for ${{ matrix.project }}" path: ${{ matrix.project }}/target/surefire-reports/*.xml reporter: java-junit fail-on-error: true - - name: Publish Unit Test report for forked repo + - name: Annotate only test report for forked repo uses: mikepenz/action-junit-report@ec3a351c13e080dc4fa94c49ab7ad5bf778a9668 # v5 if: ${{ failure() && (github.event.pull_request.head.repo.full_name != github.repository) }} # only report if a test has failed and we are a forked repo with: