name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ "**" ]
jobs:
build:
name: Build on ${{ matrix.distro }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
distro: [ jazzy ]
container:
image: ros:${{ matrix.distro }}-ros-base
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain and build tools
shell: bash
run: |
set -euxo pipefail
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
pkg-config build-essential ca-certificates curl git libclang-dev
curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Show versions
shell: bash
run: |
set -eo pipefail
. /opt/ros/${{ matrix.distro }}/setup.bash
rustc --version
cargo --version
echo "ROS_DISTRO=$ROS_DISTRO"
- name: Cargo build
shell: bash
run: |
set -eo pipefail
. /opt/ros/${{ matrix.distro }}/setup.bash
cargo build --locked --verbose
- name: Cargo test
shell: bash
run: |
set -eo pipefail
. /opt/ros/${{ matrix.distro }}/setup.bash
cargo test --locked --verbose