Skip to content

Commit

Permalink
matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesw committed Nov 5, 2024
1 parent a05bcf3 commit df3e028
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 399 deletions.
124 changes: 0 additions & 124 deletions .github/workflows/maven_test_artifact.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/maven_test_report.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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/[email protected]
# 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

4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/pr_completed.yml

This file was deleted.

73 changes: 0 additions & 73 deletions .github/workflows/unit_tests_artifact.yml

This file was deleted.

Loading

0 comments on commit df3e028

Please sign in to comment.