cql2 0.5.7

Parse, validate, and convert Common Query Language (CQL2) text and JSON
Documentation
name: CI

on:
  push:
    branches:
      - main
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
      # We've run out of disk space while building libduckdb-sys, so this gives
      # us more headroom in a quite hackey way.
      - name: Free Disk Space
        run: |
          sudo rm -rf /usr/share/dotnet
          sudo rm -rf /usr/local/lib/android
          sudo rm -rf /opt/ghc
          sudo rm -rf /opt/hostedtoolcache/CodeQL
          df -h
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
      - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
      - name: Force libduckdb-sys to re-fetch its prebuilt library
        # rust-cache prunes target/duckdb-download and the libduckdb copy in
        # target/*/deps because they don't look like normal cargo artifacts, but
        # it keeps the compiled libduckdb-sys crate and its build-script
        # fingerprint. On a cache hit cargo therefore skips the build script and
        # the prebuilt libduckdb.so is never re-downloaded, so linking the tests
        # fails with `unable to find library -lduckdb`. Clearing the fingerprint
        # forces the build script to run again and re-fetch the library.
        run: rm -rf target/*/.fingerprint/libduckdb-sys-* target/*/build/libduckdb-sys-*
      - name: Format
        run: cargo fmt --check
      - name: Check
        run: cargo check --workspace
      - name: Test
        run: cargo test
  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
      - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
      - name: Clippy
        run: cargo clippy --workspace --tests -- -D warnings
  test-python:
    name: Test Python
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
      - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
      - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
        with:
          python-version: ${{ matrix.python-version }}
      - name: Lint
        run: |
          uv run mypy python
          uv run ruff check
          uv run ruff format --check
      - name: Test
        run: uv run pytest
      - name: CLI smoke test
        run: uv run cql2 < examples/text/example01.txt
  wasm-nodejs:
    name: WASM (Node.js)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
      - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
      - name: Install wasm-pack
        run: cargo install wasm-pack
      - name: Build for Node.js
        run: wasm-pack build --target nodejs wasm
      - name: Test (Rust unit tests in Node.js)
        run: wasm-pack test --node wasm
      - name: Setup Node.js
        uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
        with:
          node-version: "20"
      - name: Test (JavaScript integration tests)
        run: npm --prefix wasm test
  wasm-web:
    name: WASM (web)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
      - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
      - name: Install wasm-pack
        run: cargo install wasm-pack
      - name: Build for web
        run: wasm-pack build --target web wasm
      - name: Setup Node.js
        uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
        with:
          node-version: "20"
      - name: Test (JavaScript integration tests with web target)
        run: npm --prefix wasm test
      - name: Test (Rust unit tests in web)
        run: wasm-pack test --headless --firefox wasm