forked from rust-osdev/uefi-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
199 lines (168 loc) · 5.72 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * 0-6'
jobs:
test_aarch64:
name: Build and run tests on AArch64
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install qemu and OVMF
run: |
# Ubuntu 20.04 provides qemu 4.2, which crashes on exit in this
# test. Add a PPA to provide a more recent version of qemu.
sudo add-apt-repository ppa:canonical-server/server-backports
sudo apt-get update
sudo apt-get install qemu-system-arm qemu-efi-aarch64 -y
# Copy the files so that the vars file isn't read-only.
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 latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rust-src
# TODO: cache Rust binaries
- name: Build
run: cargo xtask build --target aarch64
- name: Run VM tests
run: cargo xtask run --target aarch64 --headless --ci
timeout-minutes: 2
test_x86_64:
name: Build and run tests on x86_64
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install qemu and OVMF
run: |
sudo apt-get update
sudo apt-get install qemu-system-x86 ovmf -y
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rust-src
# TODO: cache Rust binaries
- name: Build
run: cargo xtask build --target x86_64
- name: Run VM tests
run: cargo xtask run --target x86_64 --headless --ci
timeout-minutes: 2
test_ia32:
name: Build and run tests on IA32
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install qemu
run: |
# Ubuntu 20.04 provides qemu 4.2, which crashes on exit in this
# test. Add a PPA to provide a more recent version of qemu.
sudo add-apt-repository ppa:canonical-server/server-backports
sudo apt-get update
sudo apt-get install qemu-system-x86 -y
# Starting in ubuntu 21.04 there's an `ovmf-ia32` package, but the
# github runners are on ubuntu 20.04. For now, install the OVMF
# files from a repo that provides unofficial nightly builds:
# https://github.com/retrage/edk2-nightly
- name: Install OVMF
env:
# Pin to a specific commit in the retrage/edk2-nightly repo to
# guard against external changes breaking the CI.
EDK2_NIGHTLY_COMMIT: 'ebb83e5475d49418afc32857f66111949928bcdc'
run: |
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 latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rust-src
# TODO: cache Rust binaries
- name: Build
run: cargo xtask build --target ia32
- name: Run VM tests
run: cargo xtask run --target ia32 --headless --ci
timeout-minutes: 2
test:
name: Run tests and documentation tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- 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
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- 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
with:
command: fmt
args: --all -- --check
- name: Run clippy
run: cargo xtask clippy --warnings-as-errors
- name: Run cargo doc
run: cargo xtask doc --warnings-as-errors
miri:
name: Run unit tests and doctests under Miri
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install latest nightly toolchain that includes Miri
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: miri
- name: Run miri
run: cargo xtask miri
# This job tests that the template app builds successfully with the
# released versions of the libraries on crates.io.
#
# Since a nightly toolchain is currently required to build uefi-rs,
# the released versions can suddenly stop building when a new nightly
# compiler with a breaking change is released. This job provides an
# alert when this situation occurs.
test_latest_release:
name: Build the template against the released version of uefi-rs
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rust-src
- name: Build
run: cargo xtask test-latest-release