Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions .github/workflows/rust-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cargo test --lib skips the integration test suite.

--lib runs only unit tests inside src/. The 40+ integration test files under Rust/core/tests/ (which PR #13 is actively fixing for Windows) are not exercised by this job.

Consider changing to cargo test (without --lib) so the full suite runs. If the integration tests are too slow for a required gate, at minimum run them in an allowed-to-fail job so regressions are visible:

- name: cargo test (full)
  run: cargo test --locked --verbose
  continue-on-error: true  # remove once integration tests are stable on CI

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
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:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Advisory clippy is the right call here — well executed.

continue-on-error: true at the job level with -D warnings in the step means warnings are surfaced in the checks tab without blocking merges. The inline comment documenting the path to flip it to blocking is exactly the right pattern for a codebase with a pre-existing warning backlog.

One note: this workflow will conflict with .github/workflows/rust-core.yml proposed in PR #16 (same filename). The maintainer should designate one of them as the canonical source and close or rebase the other.

- 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
6 changes: 5 additions & 1 deletion Rust/core/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down