Skip to content
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Run fmt
run: cargo fmt -- --check
run: rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt && cargo +nightly fmt -- --check
Copy link
Contributor

@coderabbitai coderabbitai bot Feb 24, 2026

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Nightly fmt: consider pinning the nightly version for reproducibility.

Using cargo +nightly fmt is fine for accessing unstable formatting options, but an unpinned nightly means formatting results can change day-to-day. Consider pinning to a specific nightly date (e.g., nightly-2025-12-01) to avoid spurious CI failures.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/run-tests.yml at line 54, The workflow currently installs
and uses an unpinned nightly via the run step that calls "rustup component add
--toolchain nightly-x86_64-unknown-linux-gnu rustfmt" and "cargo +nightly fmt --
--check"; change both invocations to use a specific pinned nightly (e.g.,
nightly-2025-12-01) so the toolchain and cargo+toolchain invocations are
deterministic: update the rustup --toolchain value to the pinned nightly
identifier and change the cargo +nightly invocation to cargo +nightly-YYYY-MM-DD
fmt -- --check (matching the same pinned date).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How to pin and where?

Copy link
Contributor

Choose a reason for hiding this comment

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

@snawaz, to pin the nightly version, you need to specify a date in the format nightly-YYYY-MM-DD instead of just nightly. Here's how:

Where: Line 54 in .github/workflows/run-tests.yml

Current code:

run: rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt && cargo +nightly fmt -- --check

Pinned version:

run: rustup component add --toolchain nightly-2026-02-01-x86_64-unknown-linux-gnu rustfmt && cargo +nightly-2026-02-01 fmt -- --check

How to pick a date:

  1. Choose a recent nightly that's known to work (e.g., nightly-2026-02-01)
  2. Both the --toolchain flag and the +nightly-* prefix should use the same date
  3. The date format is YYYY-MM-DD

This ensures the formatter behavior stays consistent across CI runs, preventing unexpected formatting changes when nightly Rust updates.

- name: Run clippy
run: cargo clippy -- --deny=warnings

Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
run: |
cargo build

- name: run tests
- name: run tests (cargo test-sbf)
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
cargo test-sbf --features unit_test_config
Expand Down
Loading