Skip to content

Commit 1a32cfa

Browse files
Merge pull request #375 from FS-Driverless/dev/rework-workflow
2 parents ad74992 + 3926683 commit 1a32cfa

File tree

6 files changed

+122
-37
lines changed

6 files changed

+122
-37
lines changed

.github/workflows/main.yml

Lines changed: 95 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,101 @@ on:
1111

1212
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1313
jobs:
14-
# This workflow contains a single job called "build"
15-
build:
16-
# The type of runner that the job will run on
17-
runs-on: ubuntu-20.04
14+
build: # On Linux, iterates on all ROS 1 and ROS 2 distributions.
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
ros_distribution:
19+
- noetic
20+
- humble
21+
- jazzy
1822

19-
# Steps represent a sequence of tasks that will be executed as part of the job
23+
# Define the Docker image(s) associated with each ROS distribution.
24+
# The include syntax allows additional variables to be defined, like
25+
# docker_image in this case. See documentation:
26+
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build
27+
#
28+
# Platforms are defined in REP 3 and REP 2000:
29+
# https://ros.org/reps/rep-0003.html
30+
# https://ros.org/reps/rep-2000.html
31+
include:
32+
# Noetic Ninjemys (May 2020 - May 2025)
33+
- docker_image: ghcr.io/catthehacker/ubuntu:act-20.04
34+
ros_distribution: noetic
35+
ros_version: 1
36+
37+
# Humble Hawksbill (May 2022 - May 2027)
38+
- docker_image: ghcr.io/catthehacker/ubuntu:act-22.04
39+
ros_distribution: humble
40+
ros_version: 2
41+
42+
# Jazzy Jalisco (May 2024 - May 2029)
43+
- docker_image: ubuntu:24.04
44+
ros_distribution: jazzy
45+
ros_version: 2
46+
47+
container:
48+
image: ${{ matrix.docker_image }}
2049
steps:
21-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22-
- uses: actions/checkout@v4
23-
with:
24-
submodules: recursive
25-
26-
# Runs a set of commands using the runners shell
27-
- name: Setup ROS
28-
uses: betwo/[email protected]
29-
with:
30-
# Version range or exact version of ROS version to use, using SemVer's version range syntax.
31-
ros-version: 'noetic'
32-
build-tool: 'catkin_tools'
33-
# Root directory of the catkin workspace
34-
workspace: ./ros
35-
36-
- name: Compilation settings
37-
run: |
38-
sudo apt-get -y install rsync libyaml-cpp-dev libcurl4-openssl-dev
50+
- name: Update Git
51+
run: |
52+
apt-get update
53+
apt-get install git -y
3954
40-
- name: Setup AirSim
41-
run: |
42-
./setup.sh
43-
./build.sh
44-
working-directory: ./AirSim
45-
46-
- name: Build catkin ws
47-
run: |
48-
set -ex o pipefail
49-
catkin build
50-
working-directory: ./ros
51-
env:
52-
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
55+
- uses: actions/checkout@v4
56+
with:
57+
submodules: recursive
58+
59+
- name: Ubuntu 24.04 specific apt packages
60+
if: ${{ contains(matrix.docker_image,'ubuntu:24.04') }}
61+
run: |
62+
apt-get update
63+
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
64+
apt-get install -y sudo python3-pip libboost-all-dev nodejs
65+
sudo pip3 install -U rosdep --break-system-packages
66+
67+
68+
- name: Act dependencies
69+
if: ${{ env.ACT }}
70+
run: |
71+
apt-get install gnupg lsb-release -y
72+
73+
- name: setup ROS environment
74+
uses: ros-tooling/[email protected]
75+
with:
76+
required-ros-distributions: ${{ matrix.ros_distribution }}
77+
78+
- name: Apt packages
79+
run: |
80+
apt-get update
81+
apt-get -y install rsync libyaml-cpp-dev libcurl4-openssl-dev lsb-release wget software-properties-common gnupg
82+
83+
- name: Setup AirSim
84+
run: |
85+
./setup.sh
86+
./build.sh
87+
working-directory: AirSim
88+
89+
- name: Update rosdep
90+
run: |
91+
rosdep update
92+
93+
- name: build and test ROS 1
94+
if: ${{ matrix.ros_version == 1 }}
95+
shell: bash
96+
run: |
97+
apt-get install -y python3-catkin-tools
98+
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
99+
rosdep install --from-paths src --ignore-src -r -y --rosdistro ${{ matrix.ros_distribution }}
100+
catkin init
101+
catkin build --no-status
102+
working-directory: ros
103+
104+
- name: build and test ROS 2
105+
if: ${{ matrix.ros_version == 2 }}
106+
shell: bash
107+
run: |
108+
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
109+
rosdep install --from-paths src --ignore-src -r -y --rosdistro ${{ matrix.ros_distribution }}
110+
colcon build
111+
working-directory: ros2

AirSim/build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ if [ "$(uname)" == "Darwin" ]; then
3535
elif [ "$VERSION" -lt "22" ]; then
3636
export CC="clang-8"
3737
export CXX="clang++-8"
38+
elif [ "$VERSION" -lt "24" ]; then
39+
export CC="clang-12"
40+
export CXX="clang++-12"
41+
elif [ "$VERSION" -lt "26" ]; then
42+
export CC="clang-16"
43+
export CXX="clang++-16"
3844
else
3945
export CC="clang-12"
4046
export CXX="clang++-12"

AirSim/setup.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,15 @@ if [ "$VERSION" -lt "20" ]; then
3030
sudo apt-get install -y clang-8 clang++-8 libc++-8-dev libc++abi-8-dev
3131
elif [ "$VERSION" -lt "22" ]; then
3232
sudo apt-get install -y clang-8 libc++-8-dev libc++abi-8-dev
33-
else
33+
elif [ "$VERSION" -lt "24" ]; then
3434
sudo apt-get install -y clang-12 clang++-12 libc++-12-dev libc++abi-12-dev
35+
elif [ "$VERSION" -lt "26" ]; then
36+
sudo apt-get install -y clang-16 clang++-16 libc++-16-dev libc++abi-16-dev
37+
else
38+
# Installing clang 12 for now in all other cases
39+
wget https://apt.llvm.org/llvm.sh
40+
chmod +x llvm.sh
41+
sudo ./llvm.sh 12
3542
fi
3643

3744
#install additional tools

ros2/src/fsds_ros2_bridge/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ set(RPC_LIB_INCLUDES " ${AIRSIM_ROOT}/external/rpclib/include")
1818
set(RPC_LIB rpc) # name of .a file with lib prefix
1919
message(STATUS "found RPC_LIB_INCLUDES=${RPC_LIB_INCLUDES}")
2020

21+
message(STATUS "distro $ENV{ROS_DISTRO}")
22+
if($ENV{ROS_DISTRO} STREQUAL "jazzy")
23+
add_compile_options(-DJAZZY=1)
24+
endif()
25+
2126
# find dependencies
2227
find_package(ament_cmake_auto REQUIRED)
2328
ament_auto_find_build_dependencies()

ros2/src/fsds_ros2_bridge/include/airsim_ros_wrapper.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ STRICT_MODE_OFF //todo what does this do?
2121
#include <fs_msgs/msg/extra_info.hpp>
2222
#include <fs_msgs/msg/wheel_states.hpp>
2323
#include <chrono>
24+
#ifdef JAZZY
25+
#include <cv_bridge/cv_bridge.hpp>
26+
#else
2427
#include <cv_bridge/cv_bridge.h>
28+
#endif
2529
#include <geometry_msgs/msg/pose_stamped.hpp>
2630
#include <geometry_msgs/msg/transform_stamped.hpp>
2731
#include <geometry_msgs/msg/twist_with_covariance_stamped.hpp>

ros2/src/fsds_ros2_bridge/src/fsds_ros2_bridge_camera.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
#include "vehicles/car/api/CarRpcLibClient.hpp"
88
#include "statistics.h"
99
#include "rpc/rpc_error.h"
10+
#ifdef JAZZY
11+
#include <cv_bridge/cv_bridge.hpp>
12+
#else
1013
#include <cv_bridge/cv_bridge.h>
14+
#endif
1115
#include <math.h>
1216

1317
using dseconds = std::chrono::duration<double>;

0 commit comments

Comments
 (0)