Skip to content

Commit

Permalink
Allow Rustup version to be overridden in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jdno committed Oct 8, 2024
1 parent fd3f06d commit a3a0d89
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ jobs:
name: Local rustup
runs-on: ubuntu-latest

env:
PROMOTE_RELEASE_RUSTUP_OVERRIDE_VERSION: 99.0.0

strategy:
fail-fast: false
matrix:
Expand Down
10 changes: 10 additions & 0 deletions src/rustup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ impl Context {
}

fn get_next_rustup_version(&self, sha: &str) -> anyhow::Result<String> {
// Allow the version to be overridden manually, for example to test the release process
if let Ok(version) = std::env::var("PROMOTE_RELEASE_RUSTUP_OVERRIDE_VERSION") {
println!("Using override version: {}", version);
Ok(version)
} else {
self.get_next_rustup_version_from_github(sha)
}
}

fn get_next_rustup_version_from_github(&self, sha: &str) -> anyhow::Result<String> {
println!("Getting next Rustup version from Cargo.toml...");

#[derive(Deserialize)]
Expand Down

0 comments on commit a3a0d89

Please sign in to comment.