Skip to content

Commit a3a0d89

Browse files
committed
Allow Rustup version to be overridden in tests
1 parent fd3f06d commit a3a0d89

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Diff for: .github/workflows/ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ jobs:
6565
name: Local rustup
6666
runs-on: ubuntu-latest
6767

68+
env:
69+
PROMOTE_RELEASE_RUSTUP_OVERRIDE_VERSION: 99.0.0
70+
6871
strategy:
6972
fail-fast: false
7073
matrix:

Diff for: src/rustup.rs

+10
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ impl Context {
9696
}
9797

9898
fn get_next_rustup_version(&self, sha: &str) -> anyhow::Result<String> {
99+
// Allow the version to be overridden manually, for example to test the release process
100+
if let Ok(version) = std::env::var("PROMOTE_RELEASE_RUSTUP_OVERRIDE_VERSION") {
101+
println!("Using override version: {}", version);
102+
Ok(version)
103+
} else {
104+
self.get_next_rustup_version_from_github(sha)
105+
}
106+
}
107+
108+
fn get_next_rustup_version_from_github(&self, sha: &str) -> anyhow::Result<String> {
99109
println!("Getting next Rustup version from Cargo.toml...");
100110

101111
#[derive(Deserialize)]

0 commit comments

Comments
 (0)