Skip to content

Commit

Permalink
Add option to upload test artifact
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sanchez-Mateos <[email protected]>
  • Loading branch information
rsanchez15 committed Feb 11, 2025
1 parent 530e1d0 commit 182cd0e
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 2 deletions.
8 changes: 8 additions & 0 deletions multiplatform/colcon_build_test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ inputs:
required: false
default: ''

upload_test_report_artifact:
description: >
Whether to upload the tests results as an artifact or not.
required: false
type: boolean
default: true

cmake_build_type:
description: 'Set the cmake build type'
required: false
Expand Down Expand Up @@ -71,6 +78,7 @@ runs:
workspace: ${{ inputs.workspace }}
packages_names: ${{ inputs.packages_names }}
test_report_artifact: ${{ inputs.test_report_artifact }}
upload_test_report_artifact: ${{ inputs.upload_test_report_artifact }}
colcon_test_args: ${{ inputs.colcon_test_args }}
ctest_args: ' ${{ inputs.ctest_args }}'
workspace_dependencies: ${{ inputs.workspace_dependencies }}
10 changes: 10 additions & 0 deletions multiplatform/colcon_test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ inputs:
required: false
default: ''

upload_test_report_artifact:
description: >
Whether to upload the tests results as an artifact or not.
required: false
type: boolean
default: true


outputs:
ctest_results_path:
description: "Path to test results"
Expand All @@ -72,6 +80,7 @@ runs:
workspace: ${{ inputs.workspace }}
workspace_dependencies: ${{ inputs.workspace_dependencies }}
test_report_artifact: ${{ inputs.test_report_artifact }}
upload_test_report_artifact: ${{ inputs.upload_test_report_artifact }}

- name: Run in windows
id: test_windows
Expand All @@ -87,3 +96,4 @@ runs:
workspace: ${{ inputs.workspace }}
workspace_dependencies: ${{ inputs.workspace_dependencies }}
test_report_artifact: ${{ inputs.test_report_artifact }}
upload_test_report_artifact: ${{ inputs.upload_test_report_artifact }}
9 changes: 8 additions & 1 deletion ubuntu/colcon_test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ inputs:
required: false
default: ''

upload_test_report_artifact:
description: >
Whether to upload the tests results as an artifact or not.
required: false
type: boolean
default: true

outputs:
ctest_results_path:
description: "Path to test results"
Expand Down Expand Up @@ -136,7 +143,7 @@ runs:

- name: Upload test report in JUnit format
uses: eProsima/eProsima-CI/external/upload-artifact@main
if: ${{ ! cancelled() }}
if: ${{ inputs.upload_test_report_artifact && !cancelled() }}
with:
name: ${{ inputs.test_report_artifact || format('test_report_{0}_{1}_{2}', github.workflow, github.job, join(matrix.*, '_')) }}
path: ${{ inputs.workspace }}/test_results
16 changes: 16 additions & 0 deletions ubuntu/sphinx_docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ inputs:
type: string
default: 'v2'

test_report_artifact:
description: >
Name of the artifact to be uploaded containing the test report in JUnit format. It shall be unique within the workflow run.
Default: test_report_<github.workflow>_<github.job>_<matrix.*>
required: false
default: ''

upload_test_report_artifact:
description: >
Whether to upload the tests results as an artifact or not.
required: false
type: boolean
default: true

upload_artifact_name:
description: >
Name of the artifact to upload.
Expand Down Expand Up @@ -110,6 +124,8 @@ runs:
with:
packages_names: ${{ inputs.docs_subpackage_name }}
workspace_dependencies: '${{ github.workspace }}/install'
test_report_artifact: ${{ inputs.test_report_artifact }}
upload_test_report_artifact: ${{ inputs.upload_test_report_artifact }}

- name: Upload documentation
uses: eProsima/eProsima-CI/external/upload-artifact@main
Expand Down
2 changes: 2 additions & 0 deletions versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ The [Forthcoming](#forthcoming) section includes those features added in `main`

The upcoming release will include the following **features**:

- Add an option whether to upload the test aritfact or not.

## v0.31.0

- Upgrade [upload-artifact](/external/upload-artifact/action) action version to ``v4.6.0``.
Expand Down
10 changes: 9 additions & 1 deletion windows/colcon_test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ inputs:
required: false
default: ''

upload_test_report_artifact:
description: >
Whether to upload the tests results as an artifact or not.
required: false
type: boolean
default: true


outputs:
ctest_results_path:
description: "Path to test results"
Expand Down Expand Up @@ -140,7 +148,7 @@ runs:
- name: Upload test report in JUnit format
uses: eProsima/eProsima-CI/external/upload-artifact@main
if: ${{ ! cancelled() }}
if: ${{ inputs.upload_test_report_artifact && !cancelled() }}
with:
name: ${{ inputs.test_report_artifact || format('test_report_{0}_{1}_{2}', github.workflow, github.job, join(matrix.*, '_')) }}
path: "${{ inputs.workspace }}\\test_results"

0 comments on commit 182cd0e

Please sign in to comment.