Skip to content

Update build.yml

Update build.yml #2

Workflow file for this run

name: Build ROS2 Packages for Raspberry Pi 3
on:
push:
branches:
- main # Trigger the workflow on push events to the main branch.
jobs:
build:
runs-on: ubuntu-22.04 # Specify the Ubuntu version here.
steps:
- name: Check out repository
uses: actions/checkout@v3
- 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 src --ignore-src -r -y --rosdistro humble
# Replace 'humble' with your ROS 2 distro if different.
- name: Build the ROS2 workspace
run: |
colcon build --build-base armhf_build --install-base armhf_install
# Ensure the toolchain file is correctly pointing to your ARM toolchain. --cmake-args -DCMAKE_TOOLCHAIN_FILE=path/to/your/toolchainfile.cmake
- name: Archive the build artifacts
uses: actions/upload-artifact@v2
with:
name: ros2-workspace-artifact
path: armhf_install/