zenith-rs 0.1.0

Tools to build searchers in Rust
Documentation
name: CI
on:
  pull_request:
  push:
    branches:
      - main

env:
  CARGO_INCREMENTAL: 0
  CARGO_NET_RETRY: 10
  RUST_BACKTRACE: short
  RUSTUP_MAX_RETRIES: 10

jobs:
  cleanup-runs:
    if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
    name: Cleanup old runs
    runs-on: ubuntu-latest
    steps:
      - uses: rokroskar/workflow-run-cleanup-action@master
        env:
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

  docs:
    strategy:
      matrix:
        os: [ubuntu-latest]
        toolchain: [nightly]

    name: Docs
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Install Rust toolchain
        uses: actions-rs/toolchain@v1
        id: toolchain
        if: steps.cache-toolchain.outputs.cache-hit != 'true'
        with:
          profile: minimal
          toolchain: ${{ matrix.toolchain }}
          components: cargo, clippy, rustc, rustfmt
          override: true

      - name: Cache toolchain
        uses: actions/cache@v2
        id: cache-toolchain
        with:
          path: |
            ~/.rustup/settings.toml
            ~/.rustup/toolchains/${{ matrix.toolchain }}-*
            ~/.rustup/update-hashes/${{ matrix.toolchain }}-*
          key: rust-toolchain_${{ matrix.os }}-${{ steps.toolchain.outputs.rustc_hash }}

      - name: Run docs
        uses: actions-rs/cargo@v1
        env:
          RUSTDOCFLAGS: "--cfg docsrs"
        with:
          command: doc
          args: --all-features

  lint:
    strategy:
      matrix:
        os: [ubuntu-latest]
        toolchain: [nightly]

    name: Lint
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Install Rust toolchain
        uses: actions-rs/toolchain@v1
        id: toolchain
        if: steps.cache-toolchain.outputs.cache-hit != 'true'
        with:
          profile: minimal
          toolchain: ${{ matrix.toolchain }}
          components: cargo, clippy, rustc, rustfmt
          override: true

      - name: Cache toolchain
        uses: actions/cache@v2
        id: cache-toolchain
        with:
          path: |
            ~/.rustup/settings.toml
            ~/.rustup/toolchains/${{ matrix.toolchain }}-*
            ~/.rustup/update-hashes/${{ matrix.toolchain }}-*
          key: rust-toolchain_${{ matrix.os }}-${{ steps.toolchain.outputs.rustc_hash }}

      - name: Cache dependencies
        uses: Swatinem/rust-cache@v1

      - name: Run fmt check
        run: cargo fmt --all -- --check

      - name: Run clippy
        uses: actions-rs/clippy-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          name: clippy
          # FIXME(xla): We can't move the compatibility flag into RUSTFLAGS due
          # to a regression in 1.58, in progress here:
          # https://github.com/rust-lang/rust/pull/93449
          args: --workspace --no-deps --all-features --all-targets -- -Dwarnings -Dnonstandard-style -Drust-2018-idioms -Dunused -Drust-2021-compatibility 

  test:
    strategy:
      matrix:
        os: [ubuntu-latest]
        toolchain: [stable]

    name: Test
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Install Rust toolchain
        uses: actions-rs/toolchain@v1
        id: toolchain
        if: steps.cache-toolchain.outputs.cache-hit != 'true'
        with:
          profile: minimal
          toolchain: ${{ matrix.toolchain }}
          components: cargo, clippy, rustc, rustfmt
          override: true

      - name: Cache toolchain
        uses: actions/cache@v2
        id: cache-toolchain
        with:
          path: |
            ~/.rustup/settings.toml
            ~/.rustup/toolchains/${{ matrix.toolchain }}-*
            ~/.rustup/update-hashes/${{ matrix.toolchain }}-*
          key: rust-toolchain_${{ matrix.os }}-${{ steps.toolchain.outputs.rustc_hash }}

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

      - name: Cache dependencies
        uses: Swatinem/rust-cache@v1

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