dbeel 0.1.0

dbeel is a fast and minimal distributed thread-per-core document database.
Documentation
name: Rust

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest

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

      - name: Cache setup
        uses: ./.github/actions/cache-setup

      - name: Build dbeel
        run: cargo build --verbose

      - name: Build benchmark
        run: cargo build -p blackbox-bench --verbose

      - name: Build tokio example
        run: cargo build -p tokio-example --verbose

  test:
    name: Test
    runs-on: ubuntu-latest

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

      - name: Cache setup
        uses: ./.github/actions/cache-setup

      - name: DB tests
        run: |
          cat << EOF > "run.sh"
          PATH=$PATH:/usr/share/rust/.cargo/bin
          RUST_BACKTRACE=1 cargo test
          EOF
          sudo -E bash -c "ulimit -Sl 512 && ulimit -Hl 512 && bash run.sh"

      - name: Red black tree tests
        run: |
          cat << EOF > "run.sh"
          PATH=$PATH:/usr/share/rust/.cargo/bin
          RUST_BACKTRACE=1 cargo test -p rbtree-arena
          EOF
          sudo -E bash -c "ulimit -Sl 512 && ulimit -Hl 512 && bash run.sh"

  lint:
    name: rustfmt + clippy
    runs-on: ubuntu-latest
    permissions: write-all

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

      - name: Cache setup
        uses: ./.github/actions/cache-setup

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

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

      - name: Clippy
        uses: actions-rs/clippy-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all-features