Skip to content

Commit 7a344fb

Browse files
committed
ci: add GitHub Actions build and test workflow
Run colcon build and ctest on every push/PR to main using ROS2 Jazzy on Ubuntu 24.04. Verifies compilation and unit test pass.
1 parent f90f8f4 commit 7a344fb

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-24.04
12+
container:
13+
image: ros:jazzy-ros-base
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Install system dependencies
20+
run: |
21+
apt-get update
22+
apt-get install -y --no-install-recommends \
23+
ros-jazzy-osqp-vendor \
24+
ros-jazzy-controller-interface \
25+
ros-jazzy-controller-manager \
26+
ros-jazzy-realtime-tools \
27+
ros-jazzy-pluginlib \
28+
ros-jazzy-ros2-control \
29+
ros-jazzy-ament-cmake-gtest \
30+
ros-jazzy-ament-lint-auto \
31+
ros-jazzy-ament-lint-common \
32+
libeigen3-dev
33+
rm -rf /var/lib/apt/lists/*
34+
35+
- name: Build
36+
run: |
37+
. /opt/ros/jazzy/setup.sh
38+
cd $GITHUB_WORKSPACE/..
39+
colcon build --packages-select mpc_controller
40+
41+
- name: Test
42+
run: |
43+
. /opt/ros/jazzy/setup.sh
44+
cd $GITHUB_WORKSPACE/..
45+
colcon test --packages-select mpc_controller --ctest-args -R test_
46+
colcon test-result --verbose

0 commit comments

Comments
 (0)