Add GitHub CI config (#3)

Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
This commit is contained in:
Christophe Bedard 2024-04-24 09:00:28 -07:00 committed by GitHub
parent fada2d0fc2
commit d139a0f11b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 58 additions and 5 deletions

53
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,53 @@
name: Test
on:
pull_request:
push:
branches:
- rolling
schedule:
- cron: "0 5 * * *"
jobs:
build-and-test:
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
continue-on-error: ${{ matrix.build-type == 'binary' }}
strategy:
matrix:
distro:
- rolling
build-type:
- binary
- source
env:
ROS2_REPOS_FILE_URL: 'https://raw.githubusercontent.com/ros2/ros2/${{ matrix.distro }}/ros2.repos'
steps:
- uses: actions/checkout@v3
- uses: ros-tooling/setup-ros@master
with:
required-ros-distributions: ${{ matrix.build-type == 'binary' && matrix.distro || '' }}
use-ros2-testing: true
- uses: ros-tooling/action-ros-ci@master
with:
package-name: ros2trace_analysis tracetools_analysis
target-ros2-distro: ${{ matrix.distro }}
vcs-repo-file-url: ${{ matrix.build-type == 'source' && env.ROS2_REPOS_FILE_URL || '' }}
colcon-defaults: |
{
"build": {
"mixin": [
"coverage-pytest"
]
},
"test": {
"mixin": [
"coverage-pytest"
],
"executor": "sequential",
"retest-until-pass": 2,
"pytest-args": ["-m", "not xfail"]
}
}
- uses: codecov/codecov-action@v3
with:
files: ros_ws/coveragepy/.coverage

View file

@ -122,8 +122,8 @@ class Ros2DataModelUtil(DataModelUtil):
# Get their symbol
pretty_symbols = {}
for obj in callback_objects:
# There could be multiple callback symbols for the same callback object (pointer), e.g.,
# if we create and destroy subscriptions dynamically
# There could be multiple callback symbols for the same callback object (pointer),
# e.g., if we create and destroy subscriptions dynamically
symbols = callback_symbols.loc[obj, 'symbol']
symbols = symbols if isinstance(symbols, pd.Series) else [symbols]
# In that case, just combine the symbols
@ -404,8 +404,8 @@ class Ros2DataModelUtil(DataModelUtil):
)
# There could be multiple subscriptions for the same subscription object pointer, e.g., if
# we create and destroy subscriptions dynamically, so this subscription could belong to more
# than one node
# we create and destroy subscriptions dynamically, so this subscription could belong to
# more than one node
# In that case, just combine the information
node_handles = subscriptions_info.loc[subscription_reference, 'node_handle']
node_handles = node_handles if isinstance(node_handles, pd.Series) else [node_handles]
@ -421,7 +421,7 @@ class Ros2DataModelUtil(DataModelUtil):
subscription_info = {'topic': topic_name}
# Turn list of dicts into dict of combined values
node_handle_info = {
key: ' and '.join(set(str(info[key]) for info in nodes_handle_info))
key: ' and '.join({str(info[key]) for info in nodes_handle_info})
for key in nodes_handle_info[0]
}
return {**node_handle_info, **subscription_info}