Skip to content

ci: use stable toolchain for compiling xtask #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 35 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ jobs:
cp /usr/share/AAVMF/AAVMF_CODE.fd uefi-test-runner/QEMU_EFI-pflash.raw
cp /usr/share/AAVMF/AAVMF_VARS.fd uefi-test-runner/vars-template-pflash.raw

- name: Install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rust-src
# TODO: cache Rust binaries

Expand All @@ -54,11 +58,15 @@ jobs:
sudo apt-get update
sudo apt-get install qemu-system-x86 ovmf -y

- name: Install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rust-src
# TODO: cache Rust binaries

Expand Down Expand Up @@ -97,11 +105,15 @@ jobs:
curl -o uefi-test-runner/OVMF32_CODE.fd https://raw.githubusercontent.com/retrage/edk2-nightly/${EDK2_NIGHTLY_COMMIT}/bin/RELEASEIa32_OVMF_CODE.fd
curl -o uefi-test-runner/OVMF32_VARS.fd https://raw.githubusercontent.com/retrage/edk2-nightly/${EDK2_NIGHTLY_COMMIT}/bin/RELEASEIa32_OVMF_VARS.fd

- name: Install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rust-src
# TODO: cache Rust binaries

Expand All @@ -119,13 +131,17 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rust-src
override: true

- name: Run cargo test
run: cargo xtask test
Expand All @@ -137,13 +153,17 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy, rust-src
override: true

- name: Run cargo fmt
uses: actions-rs/cargo@v1
Expand All @@ -164,6 +184,11 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install latest nightly toolchain that includes Miri
uses: actions-rs/toolchain@v1
with:
Expand All @@ -188,11 +213,15 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rust-src

- name: Build
Expand Down
15 changes: 14 additions & 1 deletion xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,26 @@ fn run_vm_tests(opt: &QemuOpt) -> Result<()> {
/// with VM tests, but a few things like macros and data types can be
/// tested with regular tests.
fn run_host_tests() -> Result<()> {
// Run xtask tests.
let cargo = Cargo {
action: CargoAction::Test,
features: Vec::new(),
toolchain: None,
packages: vec![Package::Xtask],
release: false,
target: None,
warnings_as_errors: false,
};
run_cmd(cargo.command()?)?;

// Run uefi-rs and uefi-macros tests.
let cargo = Cargo {
action: CargoAction::Test,
features: vec![Feature::Exts],
toolchain: Some(NIGHTLY.into()),
// Don't test uefi-services (or the packages that depend on it)
// as it has lang items that conflict with `std`.
packages: vec![Package::Uefi, Package::UefiMacros, Package::Xtask],
packages: vec![Package::Uefi, Package::UefiMacros],
release: false,
// Use the host target so that tests can run without a VM.
target: None,
Expand Down