|
11 | 11 |
|
12 | 12 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel |
13 | 13 | 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 |
18 | 22 |
|
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 }} |
20 | 49 | 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 | | - |
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 |
39 | 54 | |
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 |
0 commit comments