tdsql 0.1.1

Ergonomic async Microsoft SQL Server client for Rust, with typed rows and multi-result-set support
Documentation
name: CI

on:
  push:
  pull_request:

env:
  CARGO_TERM_COLOR: always

jobs:
  # Lints and the build do not need a database, so they run in parallel with
  # the test job and fail fast on the cheap problems.
  check:
    name: Lint and build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
      - uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
        with:
          toolchain: stable
          components: clippy, rustfmt
      - uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
      - name: Check formatting
        run: cargo fmt --all --check
      - name: Clippy
        run: cargo clippy --all-targets -- -D warnings
      - name: Build
        run: cargo build --all-targets
      - name: Build documentation
        run: cargo doc --no-deps

  # The MSRV declared in Cargo.toml has to keep compiling, or the field lies.
  msrv:
    name: Minimum supported Rust version
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
      - uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
        with:
          toolchain: "1.88"
      - uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
      - name: Build on MSRV
        run: cargo build

  test:
    name: Test
    runs-on: ubuntu-latest
    services:
      mssql:
        image: mcr.microsoft.com/mssql/server:2022-latest
        env:
          MSSQL_SA_PASSWORD: "YourStrong!Passw0rd"
          SA_PASSWORD: "YourStrong!Passw0rd"
          ACCEPT_EULA: "Y"
        ports:
          - 1433:1433
    steps:
      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
      - uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
      - name: Wait for SQL Server
        run: |

          for i in $(seq 1 30); do
            if nc -z localhost 1433; then
              echo "SQL Server is accepting connections"
              exit 0
            fi
            echo "Waiting for SQL Server... ($i/30)"
            sleep 5
          done
          echo "SQL Server did not come up in time"
          exit 1
      # Unit, integration and doc tests. The integration tests are #[ignore]d
      # by default because they need the database above.
      - name: Run tests
        run: cargo test --all-targets -- --include-ignored
      - name: Run doc tests
        run: cargo test --doc

  # Catch packaging problems here rather than at release time.
  package:
    name: Verify package
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
      - uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
      - name: Package
        run: cargo publish --dry-run