sux 0.14.0

A pure Rust implementation of succinct and compressed data structures
Documentation
name: Rust

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

env:
  CARGO_TERM_COLOR: always

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Check formatting
        run: cargo fmt -- --check
      - name: Clippy (default)
        run: cargo clippy --all-targets -- -D warnings
      - name: Clippy (no default features)
        run: cargo clippy --all-targets --no-default-features -- -D warnings
      - name: Clippy (all features except no_logging)
        run: cargo clippy --all-targets --features rayon,flate2,zstd,clap,cli,fuzz,mwhc,deko,serde,epserde,mmap,slow_tests -- -D warnings

  msrv:
    runs-on: ubuntu-latest
    needs: lint
    steps:
      - uses: actions/checkout@v6
      - name: Install rust (1.85.0)
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: 1.85.0
      - name: Check (MSRV, all features except no_logging)
        run: cargo check --all-targets --features rayon,flate2,zstd,clap,cli,fuzz,mwhc,deko,serde,epserde,mmap,slow_tests

  build:
    runs-on: ubuntu-latest
    needs: lint
    strategy:
      matrix:
        rust:
          - stable
          - beta
          - nightly
        features:
          - ""
          - "--no-default-features"
          - "--features rayon,flate2,zstd,clap,cli,fuzz,mwhc,deko,serde,epserde,mmap"
        include:
          - rust: nightly
            features: "--features rayon,flate2,zstd,clap,cli,fuzz,mwhc,deko,serde,epserde,mmap,aarch64_prefetch,iter_advance_by"

    steps:
      - name: Install rust (${{ matrix.rust }})
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
      - uses: actions/checkout@v6
      - name: Build
        run: cargo build --all-targets --verbose ${{ matrix.features }}
      - name: Test
        run: cargo test --verbose ${{ matrix.features }}

  docs:
    runs-on: ubuntu-latest
    needs: lint
    steps:
      - uses: actions/checkout@v6
      - name: Install nightly
        uses: dtolnay/rust-toolchain@nightly
      - name: Build docs
        env:
          RUSTDOCFLAGS: "--cfg docsrs"
        run: cargo +nightly doc --all-features --no-deps

  coverage:
    needs: build
    name: coverage
    runs-on: ubuntu-latest
    container:
      image: xd009642/tarpaulin:develop-nightly
      options: --security-opt seccomp=unconfined
    steps:
      - name: Checkout repository
        uses: actions/checkout@v6

      - name: Generate code coverage
        run: |
          cargo +nightly tarpaulin --verbose --engine llvm --features rayon,flate2,zstd,clap,cli,fuzz,mwhc,deko,serde,epserde,mmap --workspace --out Lcov

      - name: Coveralls
        uses: coverallsapp/github-action@v2
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          path-to-lcov: "lcov.info"

  build-i686:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Install 32-bit support
        run: sudo apt-get update && sudo apt-get install -y gcc-multilib
      - name: Add i686 target
        run: rustup target add i686-unknown-linux-gnu
      - name: Build (32-bit)
        run: cargo build --all-targets --features rayon,flate2,zstd,clap,cli,fuzz,mwhc,deko,serde,epserde,mmap,slow_tests --target i686-unknown-linux-gnu
      - name: Test (32-bit)
        run: cargo test --features rayon,flate2,zstd,clap,cli,fuzz,mwhc,deko,serde,epserde,mmap --target i686-unknown-linux-gnu