Skip to content

ci: add build-check workflow (cargo build on PRs)#8

Closed
nsaini-figma wants to merge 2 commits into
mainfrom
nsaini/ci-build-check
Closed

ci: add build-check workflow (cargo build on PRs)#8
nsaini-figma wants to merge 2 commits into
mainfrom
nsaini/ci-build-check

Conversation

@nsaini-figma
Copy link
Copy Markdown
Collaborator

Summary

Adds .github/workflows/build-check.yml. On every pull request and push to main, runs cargo build --release -p statsig_ffi (the same crate the release workflow cross-builds). PRs that break compilation are caught before merge.

Why

PR #4 added a new field to StatsigOptions but missed an exhaustive struct literal in statsig-ffi/src/statsig_options_c.rs. The fork has no PR-time compile gate, so the failure only surfaced when the release workflow tried to cross-build the cdylib after merge. PR #7 fixes the field. This PR adds the gate so the next time something similar slips through, it's caught at PR review instead of release time.

What changed

  • New file .github/workflows/build-check.yml. One job. Steps: checkout with submodules, install Rust stable, apt-install protobuf-compiler, cargo build --release -p statsig_ffi.

What is intentionally NOT in this workflow

  • No tests (cargo test). The fork doesn't have the API keys most integration tests need.
  • No clippy or rustfmt gate. Can be added later if useful; right now the goal is just "does it compile."
  • No matrix across platforms. The release artifact is linux-gnu/x86_64; that's what we compile.
  • No cross-build. Native build catches the same compile errors as cross and is faster (~1m20s locally).

Test plan

  • This PR's own build-check run is green (the workflow that's being added passes against itself).
  • After merge, future PRs that introduce compile errors fail at this check rather than at release-tag time.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

nsaini-figma and others added 2 commits May 14, 2026 18:49
… initializers

The bounded-LRU change added a new field `exposure_dedupe_max_keys` to
StatsigOptions but two sibling crates have exhaustive struct literals
that don't use `..StatsigOptions::default()`:

  statsig-ffi/src/statsig_options_c.rs:139
  statsig-pyo3/src/statsig_options_py.rs:334

Both now fail to compile with E0063 "missing field". This PR adds the
field (defaulted to None) to both initializers so cdylib and Python
bindings builds compile again.

The C/Python bindings don't surface the new option to callers — that
would require adding fields to StatsigOptionsData (C) and
StatsigOptionsPy (Python) and threading them through. Defaulting to
None preserves the existing behavior (uses SAMPLING_MAX_KEYS) for
non-Rust callers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Runs `cargo build --release -p statsig_ffi` on every pull request and
on push to main. This is the same crate that the figma-release workflow
cross-builds, so PR-time compile failures match what the release would
hit at tag time.

Catches compile errors before merge. Specifically, the missing-field
bug fixed in PR #7 (added a field to StatsigOptions but missed an
exhaustive struct literal in statsig-ffi) would have been caught here.

Independent of upstream's main.yml suite (which expects upstream-only
secrets and infrastructure). Minimal third-party action surface
(actions/checkout, dtolnay/rust-toolchain) plus an apt install of
protobuf-compiler.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant