Skip to content

Commit ecd12ec

Browse files
ci: Drop test_latest_release job
This job was useful when we were on the nightly channel and using various unstable features that could break at any time, but there's not much value to keeping it now that we're on the stable channel. The other minor thing the job checked was that the specific build command provided in the tutorial (originally in `BUILDING.md`) works. That was helpful back when we had some unstable (and verbose) `-Zbuild-std` flags, but now the build command is just `cargo build --target x86_64-unknown-uefi` which doesn't really need testing.
1 parent 175abac commit ecd12ec

File tree

3 files changed

+2
-72
lines changed

3 files changed

+2
-72
lines changed

.github/workflows/rust.yml

-22
Original file line numberDiff line numberDiff line change
@@ -104,28 +104,6 @@ jobs:
104104
- name: Verify generated code is up-to-date
105105
run: cargo xtask gen-code --check
106106

107-
# This job tests that the template app builds successfully with the
108-
# released versions of the libraries on crates.io.
109-
#
110-
# Since a nightly toolchain is currently required to build uefi-rs,
111-
# the released versions can suddenly stop building when a new nightly
112-
# compiler with a breaking change is released. This job provides an
113-
# alert when this situation occurs.
114-
test_latest_release:
115-
name: Build the template against the released version of uefi-rs
116-
runs-on: ubuntu-latest
117-
steps:
118-
- name: Checkout sources
119-
uses: actions/checkout@v3
120-
121-
- name: Set MSRV toolchain
122-
run: cp .github/workflows/msrv_toolchain.toml rust-toolchain.toml
123-
124-
- uses: Swatinem/rust-cache@v2
125-
126-
- name: Build
127-
run: cargo xtask test-latest-release
128-
129107
windows:
130108
name: Check that the build works on a Windows target
131109
runs-on: windows-latest

xtask/src/main.rs

+2-45
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ mod util;
1313
use crate::opt::TestOpt;
1414
use anyhow::Result;
1515
use arch::UefiArch;
16-
use cargo::{fix_nested_cargo_env, Cargo, CargoAction, Feature, Package, TargetTypes};
16+
use cargo::{Cargo, CargoAction, Feature, Package, TargetTypes};
1717
use clap::Parser;
1818
use itertools::Itertools;
1919
use opt::{Action, BuildOpt, ClippyOpt, DocOpt, Opt, QemuOpt, TpmVersion};
20-
use std::process::Command;
21-
use tempfile::TempDir;
22-
use util::{command_to_string, run_cmd};
20+
use util::run_cmd;
2321

2422
fn build_feature_permutations(opt: &BuildOpt) -> Result<()> {
2523
for package in [Package::Uefi, Package::UefiServices] {
@@ -201,46 +199,6 @@ fn run_host_tests(test_opt: &TestOpt) -> Result<()> {
201199
run_cmd(cargo.command()?)
202200
}
203201

204-
/// Test that the template app builds successfully with the released
205-
/// versions of the libraries on crates.io.
206-
///
207-
/// The `build` action also builds the template app, but due to the
208-
/// `patch.crates-io` of the top-level Cargo.toml the app is built using
209-
/// the current versions of the libraries in this repo. To give warning
210-
/// when the latest crates.io releases of the libraries are broken, this
211-
/// action copies the template to a temporary directory and builds it in
212-
/// isolation.
213-
///
214-
/// The build command is also checked against the contents of
215-
/// `building.md` to ensure that the doc correctly describes how to
216-
/// build an app.
217-
fn test_latest_release() -> Result<()> {
218-
// Recursively copy the template app to a temporary directory. This
219-
// isolates the app from the full git repo so that the
220-
// `patch.crates-io` section of the root Cargo.toml doesn't apply.
221-
let tmp_dir = TempDir::new()?;
222-
let tmp_dir = tmp_dir.path();
223-
let mut cp_cmd = Command::new("cp");
224-
cp_cmd
225-
.args(["--recursive", "--verbose", "template"])
226-
.arg(tmp_dir);
227-
run_cmd(cp_cmd)?;
228-
229-
// Create cargo build command, not using the `cargo` module to make
230-
// it explicit that it matches the command in `building.md`.
231-
let mut build_cmd = Command::new("cargo");
232-
fix_nested_cargo_env(&mut build_cmd);
233-
build_cmd
234-
.args(["build", "--target", "x86_64-unknown-uefi"])
235-
.current_dir(tmp_dir.join("template"));
236-
237-
// Check that the command is indeed in building.md, then verify the
238-
// build succeeds.
239-
let building_md = include_str!("../../book/src/tutorial/building.md");
240-
assert!(building_md.contains(&command_to_string(&build_cmd)));
241-
run_cmd(build_cmd)
242-
}
243-
244202
fn main() -> Result<()> {
245203
let opt = Opt::parse();
246204

@@ -252,6 +210,5 @@ fn main() -> Result<()> {
252210
Action::Miri(_) => run_miri(),
253211
Action::Run(qemu_opt) => run_vm_tests(qemu_opt),
254212
Action::Test(test_opt) => run_host_tests(test_opt),
255-
Action::TestLatestRelease(_) => test_latest_release(),
256213
}
257214
}

xtask/src/opt.rs

-5
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ pub enum Action {
7272
Miri(MiriOpt),
7373
Run(QemuOpt),
7474
Test(TestOpt),
75-
TestLatestRelease(TestLatestReleaseOpt),
7675
}
7776

7877
/// Build all the uefi packages.
@@ -189,7 +188,3 @@ pub struct TestOpt {
189188
#[clap(long, action)]
190189
pub skip_macro_tests: bool,
191190
}
192-
193-
/// Build the template against the crates.io packages.
194-
#[derive(Debug, Parser)]
195-
pub struct TestLatestReleaseOpt;

0 commit comments

Comments
 (0)