squire 0.0.1-alpha.9

Safe and idiomatic SQLite bindings
Documentation
name: CI

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

env:
  SQLITE_RELEASE: "3.53.0"

jobs:
  docs:
    name: API documentation
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: moonrepo/setup-rust@v1
        with:
          bins: cargo-docs-rs
          cache-base: main
          channel: nightly
          targets: aarch64-apple-darwin,aarch64-unknown-linux-gnu,i686-unknown-linux-gnu,x86_64-unknown-linux-gnu
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Download SQLite
        run: >-
          cargo run -p squire-sqlite3-src-fetch "$SQLITE_RELEASE"
      - name: Build API documentation
        run: >-
          cargo docs-rs

  format:
    name: Format
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: moonrepo/setup-rust@v1
        with:
          components: rustfmt
          cache-base: main
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Check formatting
        run: >-
          cargo fmt --all --check

  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: moonrepo/setup-rust@v1
        with:
          components: clippy
          cache-base: main
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Run linter
        run: >-
          cargo clippy --features full
      - name: Download SQLite
        run: >-
          cargo run -p squire-sqlite3-src-fetch "$SQLITE_RELEASE"
      - name: Run linter (all features)
        run: >-
          cargo clippy --all-features

  test:
    name: Test
    runs-on: ${{ matrix.host }}
    strategy:
      matrix:
        channel: [stable, beta, nightly]
        host: [ubuntu-latest]
        sqlite: [bundled]
        include:
          - channel: stable
            host: ubuntu-22.04
            sqlite: linked
          - channel: stable
            host: ubuntu-24.04
            sqlite: linked
          - channel: stable
            host: ubuntu-24.04-arm
            sqlite: linked
    steps:
      - uses: actions/checkout@v6
      - uses: moonrepo/setup-rust@v1
        with:
          cache-base: main
          channel: ${{ matrix.channel }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Download SQLite
        if: matrix.sqlite != 'linked'
        run: >-
          cargo run -p squire-sqlite3-src-fetch "$SQLITE_RELEASE"
      - name: Run tests (default features)
        run: >-
          cargo test --no-default-features --features '${{ matrix.sqlite != 'linked' && matrix.sqlite || '' }} common derive multi-thread'
      - name: Run tests (full features)
        run: >-
          cargo test --no-default-features --features '${{ matrix.sqlite != 'linked' && matrix.sqlite || '' }} full derive multi-thread'
      - name: Run tests (full features + integrations)
        run: >-
          cargo test --no-default-features --features '${{ matrix.sqlite != 'linked' && matrix.sqlite || '' }} complete derive multi-thread'
      - name: Run tests (full + nightly features)
        run: >-
          cargo test --no-default-features --features '${{ matrix.sqlite != 'linked' && matrix.sqlite || '' }} full derive multi-thread nightly'
      - name: Run tests (all features)
        run: >-
          cargo test --all-features
        if: matrix.sqlite != 'linked'
      - name: Run tests (minimal features)
        run: >-
          cargo test --no-default-features --features '${{ matrix.sqlite != 'linked' && matrix.sqlite || '' }}' -- --test-threads=1