From 6c14beab496692e83617a74248d0a9d128571507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20Str=C3=B8m?= <48532094+chrstrom@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:33:13 +0200 Subject: [PATCH] Create build-workspace.yml --- .github/workflows/build-workspace.yml | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/build-workspace.yml diff --git a/.github/workflows/build-workspace.yml b/.github/workflows/build-workspace.yml new file mode 100644 index 00000000..b43b284c --- /dev/null +++ b/.github/workflows/build-workspace.yml @@ -0,0 +1,50 @@ +name: Build ROS 2 Package + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup ROS 2 + uses: ros-tooling/setup-ros@v0.6 + with: + required-ros-distributions: humble + + - name: Clone vortex-msgs + run: | + git clone https://github.com/vortexntnu/vortex-msgs.git + + - name: Create workspace + run: | + mkdir -p ~/ros2_ws/src + cp -R $GITHUB_WORKSPACE ~/ros2_ws/src/ + cp -R vortex-msgs ~/ros2_ws/src/ + + - name: Install dependencies + run: | + cd ~/ros2_ws + rosdep update + rosdep install --from-paths src --ignore-src -r -y + + - name: Build with colcon + 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 + colcon test + colcon test-result --verbose