bluest 0.6.9

A cross-platform Bluetooth Low Energy (BLE) library
Documentation
name: CI
on:
  pull_request:
  push:
    branches:
      - main
  workflow_dispatch:

jobs:
  format:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install nightly toolchain
        run: rustup toolchain add nightly --profile minimal --component rustfmt
        
      - name: rustfmt
        run: cargo +nightly fmt --all --check

  build:
    strategy:
      matrix:
        os:
          - macOS-latest
          - ubuntu-latest
          - windows-latest
    runs-on: ${{ matrix.os }}

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - run: rustup component add clippy

      - name: Install dependencies
        if: ${{ runner.os == 'Linux' }}
        run: sudo apt-get install libdbus-1-dev

      - name: Clippy (default)
        run: |
          cargo clippy --all-targets -- -D warnings

      - name: Clippy (all features)
        if: ${{ runner.os != 'Windows' }}
        run: |
          cargo clippy --all-targets --all-features -- -D warnings

      - name: Clippy (iOS)
        if: ${{ runner.os == 'macOS'}}
        run: |
          rustup target add aarch64-apple-ios
          cargo clippy --all-targets --target=aarch64-apple-ios -- -D warnings

      - name: Clippy (Android)
        run: |
          rustup target add aarch64-linux-android
          # not using --all-targets because examples don't build for Android due to `Adapter::default()`
          cargo clippy --lib --tests --target=aarch64-linux-android --features unstable -- -D warnings

      - name: Test
        run: cargo test --all