nusadb 0.1.0

Fast, stable native Rust driver and ORM for NusaDB (Nusa Wire Protocol 1.1).
Documentation
name: CI

on:
  push:
    branches: [master, 'ci/**']
  pull_request:
  workflow_dispatch:

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy

      - uses: Swatinem/rust-cache@v2

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

      # Every feature is optional and they gate real code paths, so lint each combination
      # the crate advertises rather than only the default (empty) feature set.
      - name: Clippy
        run: |
          for features in "" "tls" "async" "async-tls"; do
            echo "::group::clippy --features '${features}'"
            cargo clippy --all-targets --no-default-features --features "${features}" -- -D warnings
            echo "::endgroup::"
          done

  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        # rust-version = "1.85" in Cargo.toml; verify the crate really still builds on it.
        toolchain: ['1.85', 'stable']
    steps:
      - uses: actions/checkout@v4

      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.toolchain }}

      - uses: Swatinem/rust-cache@v2

      - name: Build (all feature combinations)
        run: |
          for features in "" "tls" "async" "async-tls"; do
            echo "::group::build --features '${features}'"
            cargo build --no-default-features --features "${features}"
            echo "::endgroup::"
          done

      # The integration tests boot a real `nusadb-server` binary. It is not present in this
      # repository, and the tests are written to skip (not fail) when they cannot find it,
      # so this runs the unit tests and confirms the integration tests at least compile.
      - name: Test
        run: cargo test --all-features

  package:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2

      - name: Verify the crate packages cleanly
        run: cargo package --allow-dirty