-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
93 lines (76 loc) · 2.91 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: 'coverage_build_test_upload'
description: 'Compile code with colcon and using coverage flags, run colcon test, generate coverage report and upload it to codecov'
inputs:
packages_names:
description: 'Name of the colcon packages to build and test'
required: true
codecov_token:
description: 'token of codecov (use codecov environment and use <secrets.CODECOV_TOKEN> as argument)'
required: true
codecov_fix_file_path:
description: 'path to codecov yml fixes file'
required: true
codecov_result_file_path:
description: 'path to codecov xml result file'
required: false
default: ${{ github.workspace }}/coverage.xml
colcon_meta_file:
description: 'colcon.meta file to set cmake options. If empty, it does not use any file'
required: false
default: ''
cmake_args:
description: 'Cmake args for colcon build'
required: false
default: ''
ctest_args:
description: 'flags passed to colcon test execution'
required: false
default: '--label-exclude "xfail"'
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: ''
exclude_tags:
description: 'arguments to exclude files or directories for gcovr'
required: false
default: ''
workspace:
description: 'Workspace to build'
required: false
default: '${{ github.workspace }}'
workspace_dependencies:
description: 'Workspace to source where dependencies are'
required: false
default: ''
runs:
using: composite
steps:
- name: Build
uses: eProsima/eProsima-CI/ubuntu/install_gcov@main
- name: Build
uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@main
with:
packages_names: ${{ inputs.packages_names }}
colcon_meta_file: ${{ inputs.colcon_meta_file }}
cmake_args: '-DBUILD_TESTS=ON -DCODE_COVERAGE=ON ${{ inputs.cmake_args }}'
ctest_args: ${{ inputs.ctest_args }}
test_report_artifact: ${{ inputs.test_report_artifact }}
workspace: ${{ inputs.workspace }}
workspace_dependencies: ${{ inputs.workspace_dependencies }}
cmake_build_type: Debug
- name: Generate report
uses: eProsima/eProsima-CI/ubuntu/generate_coverage_report@main
with:
packages_names: ${{ inputs.packages_names }}
result_file_name: ${{ inputs.codecov_result_file_path }}
fix_file_path: ${{ inputs.codecov_fix_file_path }}
source_code_directory: ${{ github.workspace }}/src
- name: Upload coverage to Codecov
uses: eProsima/eProsima-CI/external/codecov-action@main
with:
token: ${{ inputs.codecov_token }}
files: ${{ inputs.codecov_result_file_path }}
fail_ci_if_error: true
root_dir: ${{ github.workspace }}/src