ddsc 0.1.2

High-level API for the native CycloneDDS bindings (libddsc-sys).
name: Rust

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - name: Install APT pre-requisites
      run: sudo apt-get update && sudo apt-get -y install curl gnupg2 lsb-release

    - name: Add ROS 2 repository key
      run: curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

    - name: Add ROS 2 repository
      run: sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'

    - name: Update ROS 2 APT sources
      run: sudo apt-get update && sudo apt-get -y install ros-eloquent-cyclonedds

    - uses: actions/checkout@v2

    - name: Run cargo check
      uses: actions-rs/cargo@v1
      with:
        command: check

    - name: Build
      uses: actions-rs/cargo@v1
      with:
        command: build
        args: --verbose --all-targets

    - name: Clippy
      uses: actions-rs/cargo@v1
      with:
        command: clippy
        args: --all --examples

    - name: Run tests
      uses: actions-rs/cargo@v1
      with:
        command: test
        args: --verbose

    - name: Run rustfmt
      uses: actions-rs/cargo@v1
      with:
        command: fmt
        args: -- --check