|
- name: Test
-
- on:
- push:
- paths-ignore:
- - "**.md"
-
- env:
- CARGO_TERM_COLOR: always
-
- jobs:
- test:
- strategy:
- fail-fast: false
-
- matrix:
- rust:
- - 1.53.0 # MSRV
- - stable
- - beta
- - nightly
-
- ros:
- - { distro: foxy, os: ubuntu-20.04 }
- - { distro: galactic, os: ubuntu-20.04 }
- - { distro: rolling, os: ubuntu-20.04 }
-
- runs-on: ${{ matrix.ros.os }}
-
- steps:
- - uses: actions/checkout@v2
-
- - name: Install Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: ${{ matrix.rust }}
- override: true
-
- - name: Setup ROS environment
- uses: ros-tooling/setup-ros@v0.2
- with:
- required-ros-distributions: ${{ matrix.ros.distro }}
-
- - name: Install DDS
- run: |
- sudo apt install -y \
- ros-${{ matrix.ros.distro }}-rmw-fastrtps-cpp \
- ros-${{ matrix.ros.distro }}-rmw-cyclonedds-cpp
-
- - name: Run cargo check
- run: |
- source /opt/ros/${{ matrix.ros.distro }}/setup.bash
- cargo check --features $ROS_DISTRO
-
- - name: Run cargo test
- run: |
- source /opt/ros/${{ matrix.ros.distro }}/setup.bash
- cargo test -p rclrust-msg -p rclrust-msg-gen
- cargo test -p rclrust --features $ROS_DISTRO -- --test-threads 1
- RMW_IMPLEMENTATION=rmw_fastrtps_cpp cargo test -p rclrust --features $ROS_DISTRO -- --test-threads 1
- RMW_IMPLEMENTATION=rmw_cyclonedds_cpp cargo test -p rclrust --features $ROS_DISTRO -- --test-threads 1
-
- format:
- strategy:
- matrix:
- ros:
- - { distro: foxy, os: ubuntu-20.04 }
-
- runs-on: ${{ matrix.ros.os }}
-
- steps:
- - uses: actions/checkout@v2
-
- - name: Install Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: nightly
- override: true
- components: rustfmt
-
- - name: Setup ROS environment
- uses: ros-tooling/setup-ros@v0.2
- with:
- required-ros-distributions: ${{ matrix.ros.distro }}
-
- - name: Run cargo fmt
- run: |
- source /opt/ros/${{ matrix.ros.distro }}/setup.bash
- cargo fmt -- --check
-
- lint:
- strategy:
- matrix:
- ros:
- - { distro: foxy, os: ubuntu-20.04 }
-
- runs-on: ${{ matrix.ros.os }}
-
- steps:
- - uses: actions/checkout@v2
-
- - name: Install Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: stable
- override: true
- components: clippy
-
- - name: Setup ROS environment
- uses: ros-tooling/setup-ros@v0.2
- with:
- required-ros-distributions: ${{ matrix.ros.distro }}
-
- - name: Run cargo clippy
- run: |
- source /opt/ros/${{ matrix.ros.distro }}/setup.bash
- cargo clippy --features $ROS_DISTRO -- -D warnings
|