Skip to content

Commit 8d05e80

Browse files
authored
ci: lock build-channel workflow installs (#829)
* ci: lock build-channel workflow installs * test: pin override fixture to archived nightly
1 parent c95a264 commit 8d05e80

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/publish-nightly-channel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
toolchain: ${{ env.RUST_VERSION }}
2626

2727
- name: Install build-channel script
28-
run: cargo install --debug --path ./ci/build-channel
28+
run: cargo install --locked --debug --path ./ci/build-channel
2929

3030
- name: Publish nightly channel
3131
id: setup

.github/workflows/update-channel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
toolchain: ${{ env.RUST_VERSION }}
5454

5555
- name: Install build-channel script
56-
run: cargo install --debug --path ./ci/build-channel
56+
run: cargo install --locked --debug --path ./ci/build-channel
5757

5858
- name: Switch to gh-pages branch
5959
run: |

tests/testcfg/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ pub struct TestOutput {
6767

6868
pub const DATE: &str = "2022-08-30";
6969
pub const CUSTOM_TOOLCHAIN_NAME: &str = "my-toolchain";
70+
/// Archived nightly used for override-based tests so they don't depend on the latest nightly publish.
71+
pub const OVERRIDE_DATE: &str = "2025-12-31";
7072

7173
const VERSION: &Version = &Version::new(0, 1, 0);
7274
const VERSION_2: &Version = &Version::new(0, 2, 0);
@@ -262,15 +264,16 @@ pub fn delete_toolchain(cfg: &TestCfg, toolchain: &Toolchain) {
262264
/// # Examples
263265
///
264266
/// ```no_run
265-
/// use testcfg::{self, get_default_toolchain_override_toolchain, FuelupState};
267+
/// use testcfg::{self, get_default_toolchain_override_toolchain, FuelupState, OVERRIDE_DATE};
266268
///
267269
/// testcfg::setup(FuelupState::LatestToolchainInstalled, &|cfg| {
268270
/// let toolchain = get_default_toolchain_override_toolchain();
269-
/// assert_eq!(toolchain.name, format!("nightly-{}", yesterday()));
271+
/// assert_eq!(toolchain.name, format!("nightly-{OVERRIDE_DATE}"));
270272
/// });
271273
/// ```
272274
pub fn get_default_toolchain_override_toolchain() -> Toolchain {
273-
Toolchain::new(format!("nightly-{}", yesterday()).as_str()).unwrap()
275+
// Use an archived nightly so these tests don't depend on yesterday's publish succeeding.
276+
Toolchain::new(format!("nightly-{OVERRIDE_DATE}").as_str()).unwrap()
274277
}
275278

276279
fn setup_toolchain(fuelup_home_path: &Path, toolchain: &str) -> Result<()> {
@@ -349,7 +352,7 @@ pub fn setup_default_override_file(cfg: &TestCfg, component_name: Option<&str>)
349352
let toolchain_override = ToolchainOverride {
350353
cfg: OverrideCfg::new(
351354
ToolchainCfg {
352-
channel: toolchain_override::Channel::from_str(&format!("nightly-{}", yesterday()))
355+
channel: toolchain_override::Channel::from_str(&format!("nightly-{OVERRIDE_DATE}"))
353356
.unwrap(),
354357
},
355358
component_name.map(|c| {

0 commit comments

Comments
 (0)