Skip to content

Commit 281ae8a

Browse files
Add GitHub CI config (#1)
Signed-off-by: Christophe Bedard <[email protected]> Signed-off-by: Christophe Bedard <[email protected]>
1 parent ea7df9d commit 281ae8a

File tree

5 files changed

+184
-1
lines changed

5 files changed

+184
-1
lines changed

.github/workflows/dco.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: DCO
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- rolling
7+
jobs:
8+
check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python 3.x
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: '3.x'
16+
- name: Check DCO
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
run: |
20+
pip3 install -U dco-check
21+
dco-check --verbose

.github/workflows/sanity.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Sanity checks
2+
on:
3+
# TODO remove the line below
4+
pull_request:
5+
push:
6+
branches:
7+
- rolling
8+
schedule:
9+
- cron: "0 5 * * *"
10+
jobs:
11+
tracing:
12+
runs-on: ubuntu-22.04
13+
strategy:
14+
matrix:
15+
distro:
16+
- rolling
17+
build-type:
18+
- binary
19+
- source
20+
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
path: ws/src/ros2/ros2_tracing
24+
- uses: ros-tooling/setup-ros@master
25+
with:
26+
required-ros-distributions: ${{ matrix.build-type == 'binary' && matrix.distro || '' }}
27+
- name: Pre-build (source)
28+
run: |
29+
cd $GITHUB_WORKSPACE/ws
30+
vcs import src/ --input https://raw.githubusercontent.com/ros2/ros2/${{ matrix.distro }}/ros2.repos --skip-existing
31+
vcs log -l1 src/
32+
rosdep update
33+
rosdep install -r --from-paths src --ignore-src -y --rosdistro ${{ matrix.distro }} --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers"
34+
colcon build --packages-up-to tracetools ros2run ros2launch demo_nodes_cpp tracetools_launch test_tracetools
35+
if: matrix.build-type == 'source'
36+
- name: Install other dependencies (binary)
37+
run: |
38+
sudo apt-get update
39+
sudo apt-get install -y -q ros-${{ matrix.distro }}-*tracetools*
40+
if: matrix.build-type == 'binary'
41+
- name: Verify that tracing is disabled (binary)
42+
run: |
43+
source /opt/ros/${{ matrix.distro }}/setup.bash
44+
(! ros2 run tracetools status)
45+
if: matrix.build-type == 'binary'
46+
- name: Verify that tracing is disabled (source)
47+
run: |
48+
cd $GITHUB_WORKSPACE/ws
49+
source install/setup.bash
50+
(! ros2 run tracetools status)
51+
if: matrix.build-type == 'source'
52+
- name: Install LTTng
53+
run: |
54+
sudo apt-get update
55+
sudo apt-get install -q -y lttng-tools liblttng-ust-dev python3-lttng python3-babeltrace python3-pandas
56+
- name: Build tracetools (binary)
57+
run: |
58+
cd $GITHUB_WORKSPACE/ws
59+
source /opt/ros/${{ matrix.distro }}/setup.bash
60+
colcon build --packages-up-to tracetools test_tracetools
61+
if: matrix.build-type == 'binary'
62+
- name: Build tracetools (source)
63+
run: |
64+
cd $GITHUB_WORKSPACE/ws
65+
colcon build --packages-up-to tracetools --cmake-force-configure
66+
if: matrix.build-type == 'source'
67+
- name: Make sure tracing instrumentation is available
68+
run: |
69+
cd $GITHUB_WORKSPACE/ws
70+
source install/setup.bash
71+
ros2 run tracetools status
72+
- name: Generate trace and make sure it is not empty
73+
run: |
74+
cd $GITHUB_WORKSPACE/ws
75+
source install/setup.bash
76+
ros2 launch tracetools_launch example.launch.py
77+
babeltrace ~/.ros/tracing/

.github/workflows/test.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: ros2_tracing
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- rolling
7+
schedule:
8+
- cron: "0 5 * * *"
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
include:
15+
# Normal build with LTTng installed (binary)
16+
- os: ubuntu-22.04
17+
distro: rolling
18+
build-type: binary
19+
lttng: lttng-enabled
20+
instrumentation: instrumentation-enabled
21+
# Normal build with LTTng installed (source)
22+
- os: ubuntu-22.04
23+
distro: rolling
24+
build-type: source
25+
lttng: lttng-enabled
26+
instrumentation: instrumentation-enabled
27+
# Build with LTTng installed but tracing disabled
28+
- os: ubuntu-22.04
29+
distro: rolling
30+
build-type: source
31+
lttng: lttng-enabled
32+
instrumentation: instrumentation-disabled
33+
# Normal build without LTTng being installed
34+
- os: ubuntu-22.04
35+
distro: rolling
36+
build-type: source
37+
lttng: lttng-disabled
38+
instrumentation: instrumentation-enabled
39+
env:
40+
ROS2_REPOS_FILE_URL: 'https://raw.githubusercontent.com/ros2/ros2/${{ matrix.distro }}/ros2.repos'
41+
steps:
42+
- uses: actions/checkout@v3
43+
- uses: ros-tooling/setup-ros@master
44+
with:
45+
required-ros-distributions: ${{ matrix.build-type == 'binary' && matrix.distro || '' }}
46+
- name: Install LTTng
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install -q -y lttng-tools liblttng-ust-dev python3-lttng python3-babeltrace python3-pandas
50+
if: endsWith(matrix.lttng, '-enabled')
51+
- uses: ros-tooling/action-ros-ci@master
52+
with:
53+
package-name: ros2trace test_tracetools test_tracetools_launch tracetools tracetools_launch tracetools_read tracetools_test tracetools_trace
54+
target-ros2-distro: ${{ matrix.distro }}
55+
vcs-repo-file-url: ${{ matrix.build-type == 'source' && env.ROS2_REPOS_FILE_URL || '' }}
56+
extra-cmake-args: ${{ endsWith(matrix.instrumentation, '-disabled') && '-DTRACETOOLS_DISABLED=ON' || '' }}
57+
colcon-defaults: |
58+
{
59+
"build": {
60+
"mixin": [
61+
"coverage-gcc",
62+
"coverage-pytest"
63+
]
64+
},
65+
"test": {
66+
"mixin": [
67+
"coverage-pytest"
68+
]
69+
}
70+
}
71+
- name: Make sure tracing instrumentation is available
72+
run: |
73+
source ros_ws/install/setup.bash
74+
./ros_ws/build/tracetools/status
75+
if: endsWith(matrix.lttng, '-enabled') && endsWith(matrix.instrumentation, '-enabled')
76+
- name: Make sure tracing instrumentation is disabled
77+
run: |
78+
source ros_ws/install/setup.bash
79+
(! ./ros_ws/build/tracetools/status)
80+
if: endsWith(matrix.lttng, '-disabled') || endsWith(matrix.instrumentation, '-disabled')
81+
- uses: codecov/codecov-action@v3
82+
with:
83+
files: ros_ws/lcov/total_coverage.info,ros_ws/coveragepy/.coverage

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ dco:
123123
image: $BASE_IMAGE_ID:$DISTRO-base
124124
script:
125125
- pip3 install -U dco-check
126-
- dco-check --verbose
126+
- dco-check --verbose --default-branch $DISTRO
127127

128128
# Trigger docs generation
129129
trigger_gen_docs:

codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
fixes:
22
- "/builds/ros-tracing/ros2_tracing/::"
33
- "/builds/ros-tracing/ros2_tracing/install/tracetools/::tracetools/"
4+
- "/home/runner/work/ros2_tracing/ros2_tracing/ros_ws/src/ros2_tracing/::"
5+
- "/home/runner/work/ros2_tracing/ros2_tracing/ros_ws/install/tracetools/::tracetools/"

0 commit comments

Comments
 (0)