-
Notifications
You must be signed in to change notification settings - Fork 21
65 lines (48 loc) · 1.9 KB
/
ci-build.yaml
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
name: Build ROS2 Project
on: [pull_request]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install ROS 2 Humble
run: |
sudo apt update
sudo apt install -y curl gnupg lsb-release
# Add the ROS 2 GPG key
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
# Add the ROS 2 repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
# Install ROS 2 Humble desktop version
sudo apt install -y ros-humble-desktop
- name: Install Build Tools and Dependencies
run: |
sudo apt install -y python3-colcon-common-extensions python3-rosdep
# Initialize rosdep
sudo rosdep init
rosdep update
- name: Set up ROS 2 Workspace
run: |
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
# Copy the repository code to the workspace src folder
cp -r $GITHUB_WORKSPACE/* .
# Clone vortex-msgs repository
git clone https://github.com/vortexntnu/vortex-msgs.git
# Go back to workspace root
cd ~/ros2_ws
- name: Install Package Dependencies with rosdep
run: |
source /opt/ros/humble/setup.bash
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y
- name: Build ROS 2 Workspace
run: |
source /opt/ros/humble/setup.bash
cd ~/ros2_ws
colcon build --event-handlers console_cohesion+
- name: Confirm Build Success
run: |
echo "Build completed successfully."