fix(engine): make @var() comment-aware and accept --var on ci/test (#… #1411
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: engine-ci | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'engine/**' | |
| - 'schemas/**' | |
| - '.github/workflows/engine-ci.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'engine/**' | |
| - 'schemas/**' | |
| - '.github/workflows/engine-ci.yml' | |
| # CI only reads the repo; restrict the token to the minimum (CodeQL ql-for-actions). | |
| permissions: | |
| contents: read | |
| # Cancel superseded in-progress runs on the same PR — a new push supersedes the | |
| # previous run instead of letting both finish. Scoped to pull_request so a | |
| # fast-follow merge to main never cancels a main-branch validation run. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: -Dwarnings | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| # Limit parallelism — DuckDB C++ compilation is extremely memory-intensive | |
| # and OOMs the GitHub Actions runner (~7GB RAM) at default parallelism | |
| CARGO_BUILD_JOBS: 4 | |
| # Survive transient crates.io download flakes on GitHub runners (seen as | |
| # "[16] Error in the HTTP2 framing layer" mid-fetch): retry the download and | |
| # force HTTP/1.1, which sidesteps the intermittent HTTP/2 framing bug. | |
| CARGO_NET_RETRY: '10' | |
| CARGO_HTTP_MULTIPLEXING: 'false' | |
| defaults: | |
| run: | |
| working-directory: engine | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| # CI-only: emit `line-tables-only` debuginfo on the dev+test profiles | |
| # instead of full debuginfo. Linking the workspace's test binaries with | |
| # full debuginfo dominated the build half of this job; line tables keep | |
| # file:line in panic backtraces while cutting codegen + link time. Both | |
| # profiles are needed — `cargo test` builds deps under `dev` but the | |
| # crates-under-test + harnesses (the part that rebuilds every run) under | |
| # `test`. Does not affect the `--release` jobs. | |
| env: | |
| CARGO_PROFILE_DEV_DEBUG: line-tables-only | |
| CARGO_PROFILE_TEST_DEBUG: line-tables-only | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2 | |
| with: | |
| workspaces: engine | |
| - name: Free disk space and add swap | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc | |
| sudo fallocate -l 4G /mnt/swapfile && sudo chmod 600 /mnt/swapfile && sudo mkswap /mnt/swapfile && sudo swapon /mnt/swapfile || true | |
| - run: sudo apt-get update && sudo apt-get install -y cmake | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@9e1e5806d4a4822de933115878265be9aaa786d9 # v2.82.2 | |
| with: | |
| tool: nextest | |
| # nextest runs all test binaries in one global scheduler instead of | |
| # serially per-binary like `cargo test`, which is the win on a suite | |
| # this wide. It builds lib + bin + integration tests (no benches / | |
| # examples — those carry no `#[test]` and are still type-checked by the | |
| # clippy job's `--all-targets`). Like the prior `cargo test --all-targets` | |
| # it does not run doctests; the workspace has none. | |
| - name: Run tests (nextest) | |
| run: cargo nextest run --all-features | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2 | |
| with: | |
| workspaces: engine | |
| - name: Free disk space and add swap | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc | |
| sudo fallocate -l 4G /mnt/swapfile && sudo chmod 600 /mnt/swapfile && sudo mkswap /mnt/swapfile && sudo swapon /mnt/swapfile || true | |
| - run: sudo apt-get update && sudo apt-get install -y cmake | |
| - run: cargo clippy --all-targets --all-features -- -D warnings | |
| fmt: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt -- --check | |
| adapter-boundary: | |
| name: Adapter boundary | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Check CLI adapter boundary | |
| run: bash ../scripts/lint-adapter-boundary.sh | |
| # Regression guard for the `valkey` Cargo feature on rocky-fivetran + | |
| # rocky-cache. The release workflow builds with default features only, so | |
| # `cargo test --all-features` above can't catch a dropped dep-edge flag — | |
| # workspace-level --all-features force-enables every feature regardless of | |
| # how rocky-cli wires its deps. This job mirrors the exact release-build | |
| # invocation and then exercises the tiered cache backend via `rocky doctor`, | |
| # which fails-loud if the feature isn't compiled in. | |
| # | |
| # Root cause when this guard was added: v1.39.0 linux release shipped | |
| # without `--features valkey`, every EKS code-server cold-started with | |
| # `failed to build [adapter.fivetran.cache] backend` (gold-dev 2026-05-20). | |
| release-build-smoke: | |
| name: Release-build smoke (valkey feature) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2 | |
| with: | |
| workspaces: engine | |
| - name: Free disk space and add swap | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc | |
| sudo fallocate -l 4G /mnt/swapfile && sudo chmod 600 /mnt/swapfile && sudo mkswap /mnt/swapfile && sudo swapon /mnt/swapfile || true | |
| - run: sudo apt-get update && sudo apt-get install -y cmake | |
| # Mirror engine-release.yml exactly: default features only, no --features flags. | |
| - name: Build rocky with release flags | |
| run: cargo build --release --bin rocky | |
| - name: Doctor must build tiered cache backend | |
| run: | | |
| set -euo pipefail | |
| tmp=$(mktemp -d) | |
| cat > "$tmp/rocky.toml" <<'TOML' | |
| [adapter.test_databricks] | |
| type = "databricks" | |
| host = "x" | |
| http_path = "x" | |
| token = "x" | |
| [adapter.test_fivetran] | |
| type = "fivetran" | |
| kind = "discovery" | |
| destination_id = "x" | |
| api_key = "x" | |
| api_secret = "x" | |
| [adapter.test_fivetran.cache] | |
| backend = "tiered" | |
| file_root = "/tmp/rocky-cache-smoke" | |
| object_store_url = "s3://test-bucket/cache/" | |
| valkey_url = "rediss://localhost:6379" | |
| TOML | |
| out=$(./target/release/rocky --config "$tmp/rocky.toml" --state-path "$tmp/state.redb" --output json doctor --check auth 2>&1) || true | |
| echo "$out" | |
| if echo "$out" | grep -q "failed to build \[adapter.test_fivetran.cache\] backend"; then | |
| echo "::error::valkey feature is missing from the shipped binary. Check engine/crates/rocky-cli/Cargo.toml for features=[\"valkey\"] on rocky-fivetran and rocky-cache." | |
| exit 1 | |
| fi | |
| # Coverage and audit moved to engine-weekly.yml to reduce per-PR cost. |