|
| 1 | +name: ros CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + # you may want to configure the branches that this should be run on here. |
| 6 | + branches: [ "master" ] |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + test_docker: # On Linux, iterates on all ROS 1 and ROS 2 distributions. |
| 11 | + runs-on: ubuntu-latest |
| 12 | + permissions: |
| 13 | + contents: read |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + ros_distribution: |
| 17 | + # - noetic |
| 18 | + - humble |
| 19 | + # - iron |
| 20 | + |
| 21 | + # Define the Docker image(s) associated with each ROS distribution. |
| 22 | + # The include syntax allows additional variables to be defined, like |
| 23 | + # docker_image in this case. See documentation: |
| 24 | + # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build |
| 25 | + # |
| 26 | + # Platforms are defined in REP 3 and REP 2000: |
| 27 | + # https://ros.org/reps/rep-0003.html |
| 28 | + # https://ros.org/reps/rep-2000.html |
| 29 | + include: |
| 30 | + # Noetic Ninjemys (May 2020 - May 2025) |
| 31 | + # - docker_image: ubuntu:focal |
| 32 | + # ros_distribution: noetic |
| 33 | + # ros_version: 1 |
| 34 | + |
| 35 | + # Humble Hawksbill (May 2022 - May 2027) |
| 36 | + - docker_image: ubuntu:jammy |
| 37 | + ros_distribution: humble |
| 38 | + ros_version: 2 |
| 39 | + |
| 40 | + # Iron Irwini (May 2023 - November 2024) |
| 41 | + # - docker_image: ubuntu:jammy |
| 42 | + # ros_distribution: iron |
| 43 | + # ros_version: 2 |
| 44 | + |
| 45 | + # # Rolling Ridley (No End-Of-Life) |
| 46 | + # - docker_image: ubuntu:jammy |
| 47 | + # ros_distribution: rolling |
| 48 | + # ros_version: 2 |
| 49 | + |
| 50 | + container: |
| 51 | + image: ${{ matrix.docker_image }} |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v6 |
| 54 | + with: |
| 55 | + path: src/livox_ros_driver2 |
| 56 | + - name: setup ROS environment |
| 57 | + uses: ros-tooling/setup-ros@v0.7 |
| 58 | + - name: install build dependencies |
| 59 | + run: | |
| 60 | + apt-get update |
| 61 | + apt-get install -y build-essential cmake |
| 62 | + - name: install Livox SDK2 |
| 63 | + run: | |
| 64 | + REPO_DIR="/tmp/livox_sdk2_repo" |
| 65 | + mkdir -p "$REPO_DIR" |
| 66 | + git clone --branch v1.2.5 --depth 1 https://github.com/Livox-SDK/Livox-SDK2.git "$REPO_DIR/Livox-SDK2" |
| 67 | + cd "$REPO_DIR/Livox-SDK2" |
| 68 | + mkdir -p build && cd build |
| 69 | + cmake .. |
| 70 | + make -j$(nproc) |
| 71 | + make install |
| 72 | + ldconfig |
| 73 | + rm -rf "$REPO_DIR" |
| 74 | + - name: build and test ROS 2 |
| 75 | + if: ${{ matrix.ros_version == 2 }} |
| 76 | + uses: ros-tooling/action-ros-ci@v0.3 |
| 77 | + with: |
| 78 | + import-token: ${{ github.token }} |
| 79 | + target-ros2-distro: ${{ matrix.ros_distribution }} |
| 80 | + skip-tests: true |
0 commit comments