From 0c12a046d0142a26d155bf9e64a31a428379fce3 Mon Sep 17 00:00:00 2001 From: Sanjays2402 <51058514+Sanjays2402@users.noreply.github.com> Date: Tue, 2 Jun 2026 23:05:52 -0700 Subject: [PATCH 1/2] ci: add rust-core GitHub Actions workflow Adds the first CI for the Rust core crate. The repo currently has no .github/workflows, so every PR (and main push) merges without any automated check. New workflow (.github/workflows/rust-core.yml) runs on changes under Rust/ and to the workflow itself, with three jobs: - fmt: cargo fmt --check, gated on the MSRV (1.94). - build-test: cargo build --lib + cargo test --lib on ubuntu-latest and macos-15. macOS is included because the iOS static-library output ships from a macOS host in practice. - clippy: cargo clippy --lib --no-deps -- -D warnings, advisory (continue-on-error: true) because the crate currently emits ~120 pre-existing clippy warnings. The job still surfaces them in the checks tab so they can be cleaned up incrementally; flip continue-on-error to false once the backlog is clear. Also fixes one pre-existing rustfmt diff in export.rs that was blocking 'cargo fmt --check' from going green on main. --- .github/workflows/rust-core.yml | 83 +++++++++++++++++++++++++++++++++ Rust/core/src/export.rs | 6 ++- 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/rust-core.yml diff --git a/.github/workflows/rust-core.yml b/.github/workflows/rust-core.yml new file mode 100644 index 000000000..5d29a8938 --- /dev/null +++ b/.github/workflows/rust-core.yml @@ -0,0 +1,83 @@ +name: rust-core + +on: + push: + branches: [main] + paths: + - 'Rust/**' + - '.github/workflows/rust-core.yml' + pull_request: + paths: + - 'Rust/**' + - '.github/workflows/rust-core.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + # MSRV pulled from Rust/core/Cargo.toml (`rust-version = "1.94"`). + # Keep this in sync if Cargo.toml is bumped. + RUST_TOOLCHAIN: "1.94" + +jobs: + fmt: + name: cargo fmt + runs-on: ubuntu-latest + defaults: + run: + working-directory: Rust/core + steps: + - uses: actions/checkout@v4 + - name: Install Rust ${{ env.RUST_TOOLCHAIN }} with rustfmt + run: | + rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --profile minimal --component rustfmt + rustup default ${{ env.RUST_TOOLCHAIN }} + - run: cargo fmt --all -- --check + + build-test: + name: build + test (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-15] + defaults: + run: + working-directory: Rust/core + steps: + - uses: actions/checkout@v4 + - name: Install Rust ${{ env.RUST_TOOLCHAIN }} + run: | + rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --profile minimal + rustup default ${{ env.RUST_TOOLCHAIN }} + - uses: Swatinem/rust-cache@v2 + with: + workspaces: Rust/core + - name: cargo build --lib + run: cargo build --lib --verbose + - name: cargo test --lib + run: cargo test --lib --verbose + + clippy: + name: cargo clippy (advisory) + runs-on: ubuntu-latest + defaults: + run: + working-directory: Rust/core + # Advisory only for now: the crate currently emits ~120 clippy warnings. + # This job surfaces them in the PR checks tab without blocking merges. + # Flip `continue-on-error` to `false` once the existing warnings are cleared. + continue-on-error: true + steps: + - uses: actions/checkout@v4 + - name: Install Rust ${{ env.RUST_TOOLCHAIN }} with clippy + run: | + rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --profile minimal --component clippy + rustup default ${{ env.RUST_TOOLCHAIN }} + - uses: Swatinem/rust-cache@v2 + with: + workspaces: Rust/core + - run: cargo clippy --lib --no-deps -- -D warnings diff --git a/Rust/core/src/export.rs b/Rust/core/src/export.rs index dfd32d3cb..f2fc19888 100644 --- a/Rust/core/src/export.rs +++ b/Rust/core/src/export.rs @@ -6348,7 +6348,11 @@ fn validate_metric_json_fields( &format!("{row_name} provenance_json"), issues, ); - validate_no_platform_metric_source_json(inputs_json, &format!("{row_name} inputs_json"), issues); + validate_no_platform_metric_source_json( + inputs_json, + &format!("{row_name} inputs_json"), + issues, + ); validate_no_platform_metric_source_json( quality_flags_json, &format!("{row_name} quality_flags_json"), From 2808183481888f8e040e5d605160bc8bdbbf73dc Mon Sep 17 00:00:00 2001 From: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com> Date: Sun, 12 Jul 2026 14:55:21 -0700 Subject: [PATCH 2/2] ci: surface full Rust test suite --- .github/workflows/rust-core.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/rust-core.yml b/.github/workflows/rust-core.yml index 5d29a8938..d90492c57 100644 --- a/.github/workflows/rust-core.yml +++ b/.github/workflows/rust-core.yml @@ -61,6 +61,25 @@ jobs: - name: cargo test --lib run: cargo test --lib --verbose + full-test: + name: cargo test (full, advisory) + runs-on: ubuntu-latest + continue-on-error: true + defaults: + run: + working-directory: Rust/core + steps: + - uses: actions/checkout@v4 + - name: Install Rust ${{ env.RUST_TOOLCHAIN }} + run: | + rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --profile minimal + rustup default ${{ env.RUST_TOOLCHAIN }} + - uses: Swatinem/rust-cache@v2 + with: + workspaces: Rust/core + - name: cargo test + run: cargo test --locked --verbose + clippy: name: cargo clippy (advisory) runs-on: ubuntu-latest