forked from rust-osdev/uefi-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (169 loc) · 5.84 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
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