Skip to content

Commit

Permalink
Merge pull request #477 from vortexntnu/ci-make-pipeline-build
Browse files Browse the repository at this point in the history
Add CI/CD Pipeline that tests that the codebase can build
  • Loading branch information
kluge7 authored Oct 5, 2024
2 parents fe4077a + b5a1dc9 commit 6f489c3
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 16 deletions.
6 changes: 6 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
IndentWidth: 2
AccessModifierOffset: -2
UseTab: Never
ColumnLimit: 0
NamespaceIndentation: All
72 changes: 72 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build and Test

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: Run Tests
run: |
source /opt/ros/humble/setup.bash
cd ~/ros2_ws
colcon test --event-handlers console_direct+
- name: Test Results Summary
run: |
cd ~/ros2_ws
colcon test-result --verbose
7 changes: 0 additions & 7 deletions auv_setup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ endif()

find_package(ament_cmake REQUIRED)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

# Install launch files.
install(DIRECTORY
config
Expand Down
3 changes: 0 additions & 3 deletions auv_setup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down
2 changes: 0 additions & 2 deletions mission/joystick_interface_auv/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>ros2launch</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>ament_cmake_pytest</test_depend>

<export>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <eigen3/Eigen/Dense>

namespace Eigen {
typedef Eigen::Matrix<double, 6, 1> Vector6d;
typedef Eigen::Matrix<double, 6, 1> Vector6d;
}

#endif // VORTEX_EIGEN_TYPEDEFS_H
3 changes: 0 additions & 3 deletions motion/thrust_allocator_auv/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down

0 comments on commit 6f489c3

Please sign in to comment.