Skip to content

perf(engine): process-global sqlparser Statement cache #47

perf(engine): process-global sqlparser Statement cache

perf(engine): process-global sqlparser Statement cache #47

Workflow file for this run

name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
# Cancel in-flight runs on the same branch so a quick re-push doesn't queue
# two full builds. Saves ~10–20 min of runner time per amend.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# Don't fetch the full crates.io index — sparse is the default on 1.83
# but we set it explicitly so older runners behave the same way.
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
# Pin to the toolchain the team develops against. Bump deliberately.
RUST_TOOLCHAIN: 1.83.0
# Strip debug info from CI dev builds. Free GitHub runners have ~7GB
# RAM and the workspace's test binaries (each statically links ~200
# crates) routinely OOM the linker on full debug info. `line-tables-
# only` keeps file:line numbers for panics + backtraces, which is all
# CI needs — full DWARF is for interactive debugging.
CARGO_PROFILE_DEV_DEBUG: "line-tables-only"
# NOTE: sccache via the GHA cache backend was tried here and reverted —
# the Azure-hosted artifactcache endpoint returns 400s intermittently
# (`Server startup failed: cache storage failed to read`), and because
# `RUSTC_WRAPPER=sccache` propagates to every rustc invocation, every
# build step fails when the backend is degraded. Rely on Swatinem
# rust-cache for incremental compilation across runs; that path is
# stable and gets us most of the benefit without the failure surface.
jobs:
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: rustfmt
- run: cargo fmt --all -- --check
docs-frontmatter:
name: docs frontmatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: ./scripts/check-frontmatter.sh
docs-index:
name: docs index up to date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: bash ./scripts/build-docs-index.sh --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: clippy
- uses: Swatinem/rust-cache@v2
with:
shared-key: "ci-clippy"
# v0.1 ships with non-zero clippy warnings that we're cleaning up
# incrementally. Run clippy in advisory mode for now; tighten back
# to `-D warnings` once the existing tail is cleared (tracked as a
# post-v0.1.1 cleanup). Clippy's deny-by-default lints (e.g.
# `clippy::approx_constant`) still fail the build — that's the
# intended "you wrote actively wrong code" gate.
- run: cargo clippy --workspace --all-targets
test:
# Single-OS test job — Linux only. macOS doubled runner cost without
# catching a single Linux-passes-macOS-fails case in the v0.1
# bring-up. Re-add the matrix when we have evidence the
# platform-specific paths (mimalloc, object_store local fs) actually
# need it.
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- uses: Swatinem/rust-cache@v2
with:
# Distinct key from clippy so the larger test-incremental
# artifact set doesn't evict the clippy cache.
shared-key: "ci-test"
# Postgres is optional — the basin-catalog Postgres tests skip on
# unreachable PG via `try_connect()`. We start it best-effort so
# the bonus coverage runs when available.
- name: Start Postgres
run: |
sudo systemctl start postgresql.service || true
sudo -u postgres psql -c "CREATE USER basin WITH SUPERUSER PASSWORD 'basin';" || true
sudo -u postgres psql -c "CREATE DATABASE basin OWNER basin;" || true
echo "DATABASE_URL=postgres://basin:basin@localhost:5432/basin" >> $GITHUB_ENV
# Build + test as one step: `cargo test` builds the test artefacts
# directly, so a prior `cargo build` step just doubles compile
# cost. `--locked` so a Cargo.lock drift is caught before tests run.
#
# `--exclude basin-integration-tests`: those tests are
# benchmark-flavoured viability cards (viability_*, s3_scaling_*,
# large_dataset_*) that link a near-full workspace per binary and
# routinely OOM a 7GB GitHub runner at link time
# (`ld terminated with signal 7 [Bus error]`). They're designed
# to run on a developer workstation, not on free CI. The per-
# crate unit + integration tests still run via `--workspace`.
- run: cargo test --workspace --exclude basin-integration-tests --no-fail-fast --locked
audit:
name: cargo audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
# Cache cargo bin/registry so `cargo install cargo-audit` doesn't
# rebuild from source on every push (~3-4 min saved).
- uses: Swatinem/rust-cache@v2
with:
shared-key: "ci-audit"
cache-targets: "false"
- run: cargo install cargo-audit --locked
# Default `cargo audit` exits non-zero on vulnerabilities only.
# We intentionally do NOT pass `--deny warnings` here — yanked /
# unmaintained advisories surface in the log but don't fail the
# build, since the upstream of any deep transitive dep is out of
# our control on short notice.
- run: cargo audit