Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

fix(ci): preserve pinned Rust toolchains

AkitaOnRailsfdefd3870da6
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1cf4069c..c6c6e629 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -128,6 +128,8 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # 1.95
+ with:
+ toolchain: "1.95"
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Install with a fresh dependency resolution
env:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 83f08284..41721ff1 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -77,6 +77,8 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # 1.95
+ with:
+ toolchain: "1.95"
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
@@ -132,6 +134,8 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # 1.95
+ with:
+ toolchain: "1.95"
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
@@ -200,6 +204,8 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # 1.95
+ with:
+ toolchain: "1.95"
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
diff --git a/crates/ai-memory-cli/tests/packaging.rs b/crates/ai-memory-cli/tests/packaging.rs
index f09a33dc..d8a5935f 100644
--- a/crates/ai-memory-cli/tests/packaging.rs
+++ b/crates/ai-memory-cli/tests/packaging.rs
@@ -431,6 +431,38 @@ fn github_actions_are_pinned_to_full_commits() {
}
}
+#[test]
+fn workflows_keep_fixed_rust_jobs_on_the_fixed_toolchain() {
+ for (path, expected_fixed_jobs) in [
+ (".github/workflows/ci.yml", 1),
+ (".github/workflows/release.yml", 3),
+ ] {
+ let workflow = read_repo(path);
+ let lines = workflow.lines().collect::<Vec<_>>();
+ let mut fixed_jobs = 0;
+ for (index, line) in lines.iter().enumerate().filter(|(_, line)| {
+ line.contains("uses: dtolnay/rust-toolchain@") && line.ends_with("# 1.95")
+ }) {
+ fixed_jobs += 1;
+ assert_eq!(
+ lines.get(index + 1).map(|line| line.trim()),
+ Some("with:"),
+ "{path} must configure the fixed toolchain after: {line}"
+ );
+ assert_eq!(
+ lines.get(index + 2).map(|line| line.trim()),
+ Some("toolchain: \"1.95\""),
+ "{path} must keep its # 1.95 job on Rust 1.95"
+ );
+ }
+
+ assert_eq!(
+ fixed_jobs, expected_fixed_jobs,
+ "{path} has an unexpected number of fixed Rust jobs"
+ );
+ }
+}
+
#[cfg(unix)]
#[test]
fn wrapper_self_upgrade_rejects_a_checksum_mismatch() {