Skip to content

Commit

Permalink
Merge pull request #1 from ORCID/feat/test
Browse files Browse the repository at this point in the history
feat/test
  • Loading branch information
gilesw authored Nov 6, 2024
2 parents d6f71f3 + b10ce4f commit 5e4572a
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 379 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build_test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build_test_release_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
122 changes: 0 additions & 122 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,19 +114,25 @@ jobs:
java-version: '11'

########################################################################################
- name: "Test ${{ inputs.project }}"
- name: "Test ${{ matrix.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=${{ matrix.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
- 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
if: always()
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: 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:
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_artifact:
uses: ./.github/workflows/unit_tests_artifact.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 5e4572a

Please sign in to comment.