Skip to content

Rust

Rust #220

Workflow file for this run

name: Rust
on:
push:
branches:
- main
- version-*
pull_request:
branches:
- main
- version-*
schedule:
- cron: '0 0 * * 0-6'
jobs:
test_aarch64:
name: Integration Test (AArch64)
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Install qemu and OVMF
run: |
sudo apt-get update
sudo apt-get install qemu-system-arm qemu-efi-aarch64 -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@v3
- uses: Swatinem/rust-cache@v2
- name: Install qemu and OVMF
run: |
sudo apt-get update
sudo apt-get install qemu-system-x86 ovmf 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@v3
- uses: Swatinem/rust-cache@v2
- name: Install qemu and OVMF
run: |
sudo apt-get update
sudo apt-get install qemu-system-x86 ovmf-ia32 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
- name: Checkout sources
uses: actions/checkout@v3
- 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@v3
- 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@v3
- 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
# 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@v3
- name: Set toolchain
run: cp .github/workflows/msrv_toolchain.toml rust-toolchain.toml
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo xtask build
# 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
steps:
- name: Checkout sources
uses: actions/checkout@v3
- 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
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install qemu and OVMF
run: |
sudo apt-get update
sudo apt-get install qemu-system-x86 ovmf -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