-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbe34c9
commit bac5930
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Build ROS2 Packages for Raspberry Pi 3 natively on ARM | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Trigger the workflow on push events to the main branch. | ||
|
||
jobs: | ||
build: | ||
runs-on: buildjet-2vcpu-ubuntu-2204-arm #run on ARM with Ubuntu 22 | ||
steps: | ||
- name: Setup Workspace | ||
run: | | ||
mkdir -p ros_ws/src # Create a workspace and src directory | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ros_ws/src # Checkout the repository into the src directory | ||
|
||
|
||
- name: Set up ROS environment | ||
run: | | ||
sudo apt update | ||
sudo apt install -y curl gnupg lsb-release | ||
sudo curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg | ||
echo "deb [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 | ||
sudo apt install -y python3-colcon-common-extensions python3-rosdep python3-vcstool | ||
- name: Install cross-compilation tools | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y crossbuild-essential-armhf g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf | ||
# Install any other dependencies or cross-compilation tools you might need. | ||
- name: Initialize rosdep | ||
run: | | ||
sudo rosdep init | ||
rosdep update | ||
- name: Install dependencies | ||
run: | | ||
rosdep install --from-paths ros_ws/src --ignore-src -r -y --rosdistro humble | ||
# Replace 'humble' with your ROS 2 distro if different. | ||
- name: Build the ROS2 workspace | ||
run: | | ||
source /opt/ros/humble/setup.bash | ||
cd ros_ws | ||
colcon build --symlink-install | ||
- name: Archive the build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ros2-workspace-artifact | ||
path: ros_ws |