bitmagic 0.2.4+bitmagic.7.7.7

Rust bindings for the bitmagic library.
Documentation
name: Rust checks

on:
  push:
    branches: [latest]
  pull_request:
    branches: [latest]
  schedule:
    - cron: '0 5 * * *'

jobs:
  check:
    name: Check
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2
        with:
          submodules: 'recursive'

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

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

  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        build: [beta, stable, windows, macos]
        clang: [["11.0", "clang_11_0"]]
        include:
          - build: macos
            os: macos-latest
            rust: stable
          - build: windows
            os: windows-latest
            rust: stable
          - build: beta
            os: ubuntu-latest
            rust: beta
          - build: stable
            os: ubuntu-latest
            rust: stable
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: 'recursive'

      # LLVM and Clang
      - name: Cache LLVM and Clang
        id: cache-llvm
        uses: actions/cache@v2
        with:
          path: ${{ runner.temp }}/llvm-${{ matrix.clang[0] }}
          key: ${{ matrix.os }}-llvm-${{ matrix.clang[0] }}
      - name: Install LLVM and Clang
        uses: KyleMayes/install-llvm-action@v1
        with:
          version: ${{ matrix.clang[0] }}
          directory: ${{ runner.temp }}/llvm-${{ matrix.clang[0] }}
          cached: ${{ steps.cache-llvm.outputs.cache-hit }}

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

      - name: Run tests
        uses: actions-rs/cargo@v1
        env:
          LIBCLANG_PATH: ${{ runner.temp }}/llvm-${{ matrix.clang[0] }}/lib
          LLVM_CONFIG_PATH: ${{ runner.temp }}/llvm-${{ matrix.clang[0] }}/bin/llvm-config
        with:
          command: test
          args: --no-fail-fast

  cross_testing:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        target: [
          aarch64-unknown-linux-gnu,
          powerpc64le-unknown-linux-gnu
        ]
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: 'recursive'

      - uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          target: ${{ matrix.target }}
          override: true

      - name: Run tests
        uses: actions-rs/cargo@v1
        continue-on-error: true  # TODO: need to figure out compilation errors due to constexpr
        with:
          use-cross: true
          command: test
          args: --target ${{ matrix.target }} --no-fail-fast -- --test-threads 1

  coverage:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: 'recursive'

      - uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
          override: true

      - name: Install cargo-tarpaulin
        uses: actions-rs/install@v0.1
        with:
          crate: cargo-tarpaulin
          version: latest
          use-tool-cache: true

      - name: Run cargo-tarpaulin
        run: cargo tarpaulin --all-features --timeout 600 --out Xml -- --test-threads 1

      - name: Upload coverage to codecov
        uses: codecov/codecov-action@v1.0.3

  lints:
    name: Lints
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2
        with:
          submodules: 'recursive'

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          components: rustfmt, clippy

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

      - name: Run cargo clippy
        uses: actions-rs/cargo@v1
        with:
          command: clippy
          args: -- -D warnings

  minimum_rust_version:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: 'recursive'

      - name: check if README matches MSRV defined here
        run: grep '1.37.0' README.md

      - uses: actions-rs/toolchain@v1
        with:
          toolchain: 1.37.0
          override: true

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

  publish:
    name: Publish (dry-run)
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2
        with:
          submodules: 'recursive'

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

      - name: Make sure we can publish
        uses: actions-rs/cargo@v1
        with:
          command: publish
          args: --dry-run