calloop 0.10.0

A callback-based event loop
Documentation
name: Continuous Integration

on:
  push:
    branches:
    - master
  pull_request:

jobs:
  ci-linux:
    name: CI

    strategy:
      fail-fast: false
      matrix:
        rust: ['1.53.0', 'stable', 'beta']
      
    runs-on: 'ubuntu-latest'

    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Cargo cache
        uses: actions/cache@v1
        with:
          path: ~/.cargo
          key: cargo-${{ matrix.rust }}

      - name: Rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          override: true

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

      - name: Install libzmq
        run: sudo apt-get -y install libzmq3-dev

      - name: Build mdBook examples
        uses: actions-rs/cargo@v1
        with:
          command: build
          args: --manifest-path doc/Cargo.toml

  coverage:
    name: Coverage

    strategy:
      fail-fast: false
      matrix:
        os: ['ubuntu-latest', 'macos-latest']

    runs-on: ${{ matrix.os }}

    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Cargo cache
        uses: actions/cache@v1
        with:
          path: ~/.cargo
          key: cargo-nightly-${{ matrix.os }}

      - name: Rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly # llvm-tools-preview requires nightly
          override: true
          components: llvm-tools-preview # Required for grcov
      
      - name: Install grcov
        uses: actions-rs/cargo@v1
        with:
          command: install
          args: grcov

      - name: Run tests
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --all-features
        env:
          LLVM_PROFILE_FILE: "calloop-%p-%m.profraw"
          RUSTFLAGS: "-Cinstrument-coverage --cfg coverage"

      - name: Coverage
        run: grcov . --binary-path ./target/debug -s . -t lcov --branch --llvm --ignore-not-existing --ignore 'examples/*' --ignore 'tests/*' --ignore '*/.cargo/registry/*' --excl-br-start "mod tests \{" --excl-start "mod tests \{" --excl-br-line "#\[derive\(" --excl-line "#\[derive\(" -o lcov.info
    
      - name: Upload to codecov.io
        uses: codecov/codecov-action@v2
        with:
          files: ./lcov.info
          flags: ${{ matrix.os }}

  lint:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true
          components: rustfmt, clippy
      
      - name: Cargo fmt
        run: cargo fmt --all -- --check
      
      - name: Clippy
        run: cargo clippy --all-features --all-targets -- -D warnings