Feature/build workspace in pipeline #5
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
name: Build ROS 2 Package | |
on: | |
push: | |
branches: [ main, development ] | |
pull_request: | |
branches: [ main, development ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup ROS 2 | |
uses: ros-tooling/[email protected] | |
with: | |
required-ros-distributions: humble | |
- name: Create workspace | |
run: | | |
mkdir -p ~/ros2_ws/src | |
cp -R $GITHUB_WORKSPACE ~/ros2_ws/src/ | |
- name: Clone vortex-msgs | |
run: | | |
cd ~/ros2_ws/src | |
git clone https://github.com/vortexntnu/vortex-msgs.git | |
- name: Install dependencies | |
run: | | |
cd ~/ros2_ws | |
rosdep update | |
rosdep install --from-paths src --ignore-src -r -y | |
- name: Build | |
run: | | |
cd ~/ros2_ws | |
. /opt/ros/humble/setup.sh | |
colcon build --symlink-install | |
- name: Run tests | |
run: | | |
cd ~/ros2_ws | |
. /opt/ros/humble/setup.sh | |
. install/setup.sh | |
colcon test | |
colcon test-result --verbose |