Rust #1329
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
merge_group: | |
push: | |
branches: | |
- main | |
- version-* | |
pull_request: | |
branches: | |
- main | |
- version-* | |
schedule: | |
- cron: '0 0 * * 0-6' | |
env: | |
RUSTFLAGS: -D warnings | |
jobs: | |
test_aarch64: | |
name: Integration Test (AArch64) | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install qemu | |
run: | | |
sudo apt-get update | |
sudo apt-get install qemu-system-arm -y | |
- name: Run VM tests | |
run: cargo xtask run --target aarch64 --headless --ci | |
timeout-minutes: 4 | |
test_x86_64: | |
name: Integration Test (x86_64) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install qemu | |
run: | | |
sudo apt-get update | |
sudo apt-get install qemu-system-x86 swtpm -y | |
- name: Run VM tests | |
run: cargo xtask run --target x86_64 --headless --ci --tpm=v1 | |
timeout-minutes: 4 | |
test_ia32: | |
name: Integration Test (IA-32) | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install qemu | |
run: | | |
sudo apt-get update | |
sudo apt-get install qemu-system-x86 swtpm -y | |
- name: Run VM tests | |
run: cargo xtask run --target ia32 --headless --ci --tpm=v2 | |
timeout-minutes: 4 | |
# Ensure that developers can build and use this crate on Windows. | |
test_x86_64_windows: | |
name: Integration Test (x86_64 Windows) | |
runs-on: windows-latest | |
steps: | |
- name: Install QEMU | |
run: choco install qemu --version 2023.4.24 | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run VM tests | |
run: cargo xtask run --target x86_64 --ci | |
timeout-minutes: 10 | |
test: | |
name: Unit + Doc Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run cargo test (without unstable) | |
run: cargo xtask test | |
lints: | |
name: Lints | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run cargo fmt | |
run: | | |
rustup component add rustfmt | |
cargo fmt --all -- --check | |
- name: Run clippy | |
run: | | |
rustup component add clippy | |
cargo xtask clippy --warnings-as-errors | |
- name: Run cargo doc (without unstable) | |
run: cargo xtask doc --warnings-as-errors --document-private-items | |
- name: Verify generated code is up-to-date | |
run: cargo xtask gen-code --check | |
- name: Run additional checks on the uefi-raw package | |
run: cargo xtask check-raw | |
# Run the build with our current stable MSRV (specified in | |
# ./msrv_toolchain.toml). This serves to check that we don't | |
# accidentally start relying on a new feature without intending | |
# to. Having a test for this makes it easier for us to be intentional | |
# about making changes that require a newer version. | |
build_msrv: | |
name: Build (stable MSRV) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Set toolchain | |
run: cp .github/workflows/msrv_toolchain.toml rust-toolchain.toml | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
# Build uefi-test-runner since its dependency tree includes all the | |
# library packages. Note that xtask isn't used or built here; since it's | |
# just a dev tool we don't care about the MSRV for that package. | |
run: cargo build --target x86_64-unknown-uefi -p uefi-test-runner | |
# This job requires the nightly channel, but keep it as a separate job from | |
# `nightly_channel` because it takes a while to run. | |
build_feature_permutations: | |
name: Build (feature permutations) | |
runs-on: ubuntu-latest | |
env: | |
# TODO: temporarily allow warnings to not be errors on nightly due to | |
# incorrect dead_code lint. | |
# https://github.com/rust-osdev/uefi-rs/issues/1205 | |
RUSTFLAGS: "" | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Set nightly toolchain so that `unstable` can be included | |
run: cp .github/workflows/nightly_toolchain.toml rust-toolchain.toml | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo xtask build --feature-permutations | |
nightly_channel: | |
name: Build (nightly + unstable feature) | |
runs-on: ubuntu-latest | |
env: | |
# TODO: temporarily allow warnings to not be errors on nightly due to | |
# incorrect dead_code lint. | |
# https://github.com/rust-osdev/uefi-rs/issues/1205 | |
RUSTFLAGS: "" | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install qemu | |
run: | | |
sudo apt-get update | |
sudo apt-get install qemu-system-x86 -y | |
- name: Enable nightly toolchain | |
run: cp .github/workflows/nightly_toolchain.toml rust-toolchain.toml | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run VM tests with the `unstable` feature | |
run: cargo xtask run --target x86_64 --headless --ci --unstable | |
timeout-minutes: 4 | |
- name: Run cargo doc with the `unstable` feature | |
run: cargo xtask doc --warnings-as-errors --document-private-items --unstable | |
- name: Run test with the `unstable` feature | |
# Skip testing uefi-macros on nightly because the tests that check the | |
# compiler error output produce different output on stable vs nightly. | |
run: cargo xtask test --unstable --skip-macro-tests | |
- name: Run unit tests and doctests under Miri | |
run: | | |
rustup component add miri | |
cargo xtask miri |