tiberius-ng 0.13.1

A TDS (Microsoft SQL Server) driver for Rust — actively-maintained community continuation of tiberius
Documentation
name: Coverage

on:
  push:
    branches: [main, qa, dev]
  pull_request:

permissions:
  contents: read

jobs:
  coverage:
    name: llvm-cov + Codecov
    runs-on: ubuntu-latest
    env:
      TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:localhost,1433;user=SA;password=<YourStrong@Passw0rd>;TrustServerCertificate=true"
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          persist-credentials: false

      - uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
        with:
          toolchain: stable
          components: llvm-tools-preview

      - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1

      - name: Install cargo-llvm-cov
        uses: taiki-e/install-action@cargo-llvm-cov

      - name: Install system dependencies
        run: sudo apt-get install -y openssl libkrb5-dev

      - name: Start SQL Server
        run: DOCKER_BUILDKIT=1 docker compose -f docker-compose.yml up -d mssql-2022

      - name: Wait for SQL Server
        run: |
          for _ in $(seq 1 45); do
            if (echo > /dev/tcp/localhost/1433) 2>/dev/null; then
              echo "SQL Server is accepting connections"; exit 0
            fi
            sleep 2
          done
          echo "SQL Server did not become ready in time" >&2; exit 1

      - name: Generate coverage (lcov)
        # Use the curated `all` feature (single TLS backend). `--all-features`
        # would enable the mutually-exclusive native-tls/rustls/vendored-openssl
        # backends simultaneously, which does not compile by design.
        run: cargo llvm-cov --features all --lcov --output-path lcov.info

      - name: Coverage summary
        # Re-report from the profdata collected above so the total line/region
        # coverage is visible directly in the CI log (independent of Codecov).
        run: cargo llvm-cov report --summary-only

      - name: Upload coverage artifact
        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
        with:
          name: lcov
          path: lcov.info

      - name: Upload coverage reports to Codecov
        uses: codecov/codecov-action@v5
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          # Pin the slug to the current repo name so uploads land on the
          # renamed Codecov project (tiberius -> tiberius-ng) rather than the
          # orphaned old-name project.
          slug: ${{ github.repository }}
          files: lcov.info
          fail_ci_if_error: false