quick_cache 0.6.21

Lightweight and high performance concurrent cache
Documentation
name: Continuous integration

on:
  push:
    branches: [master]
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  check-all-targets:
    name: Check all targets
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
      - run: cargo check --all-targets
      - run: cargo check --all-targets --features stats
      - run: cargo check --all-targets --no-default-features
      - run: cargo check --all-targets --no-default-features --features sharded-lock
      - run: cargo check --all-targets --features shuttle

  test:
    name: Tests
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
      - run: cargo test
      - run: cargo test --no-default-features
      - run: cargo test --no-default-features --features sharded-lock
      # no run because of shuttle feature and non-shuttle tests
      - run: cargo test --features shuttle --no-run

  shuttle-tests:
    name: Shuttle Tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
      - run: cargo test --profile shuttle --features shuttle shuttle

  docs:
    name: Build Docs
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          # toolchain: nightly  # Temporarily disabled due to doc_auto_cfg removal in nightly
      - run: cargo doc --features stats --package quick_cache
        # env:  # Temporarily disabled due to doc_auto_cfg removal in nightly
        #   RUSTDOCFLAGS: --cfg docsrs

  fuzz-tests:
    name: Fuzz tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly
          override: true
      - run: cargo install cargo-fuzz
      - run: for fuzz_test in `cargo fuzz list`; do cargo fuzz run $fuzz_test -- -max_total_time=30 -timeout=5 || exit 1; done

  lint:
    name: Rustfmt & Clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
      - run: rustup component add rustfmt
      - uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --all -- --check
      - run: rustup component add clippy
      - uses: actions-rs/cargo@v1
        with:
          command: clippy
          args: -- -D warnings
      - name: Install dependencies for tools
        run: sudo apt-get update && sudo apt-get -y install libfontconfig1-dev jq
      - name: Check tools
        working-directory: tools
        run: cargo clippy -- -D warnings

  miri:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Install Rust toolchain
      uses: actions-rs/toolchain@v1
      with:
        profile: minimal
        toolchain: nightly
        override: true
        components: miri
    - name: Run Miri
      run: cargo miri test