-
-
Notifications
You must be signed in to change notification settings - Fork 27
132 lines (124 loc) · 3.86 KB
/
rust.yml
File metadata and controls
132 lines (124 loc) · 3.86 KB
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
name: Build
on: [ pull_request, merge_group ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event_name }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: "${{ matrix.runs-on }}"
strategy:
fail-fast: false
matrix:
runs-on:
- macos-latest # aarch64
- ubuntu-latest # x86_64
- windows-latest # x86_64
rust:
- stable
- nightly
- 1.85.1 # MSVR
steps:
- uses: actions/checkout@v6
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "${{ matrix.rust }}"
targets: x86_64-unknown-linux-gnu,x86_64-unknown-uefi,i686-unknown-uefi,thumbv7em-none-eabihf,aarch64-unknown-uefi,riscv64gc-unknown-none-elf
- uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.runs-on }}-${{ matrix.rust }}"
- name: Build
run: cargo build --all-targets --verbose
- name: Build (no_std, x86, aarch64, riscv)
run: |
cargo build --verbose --all-features --target aarch64-unknown-uefi
cargo build --verbose --all-features --target i686-unknown-uefi
cargo build --verbose --all-features --target riscv64gc-unknown-none-elf
cargo build --verbose --all-features --target thumbv7em-none-eabihf
cargo build --verbose --all-features --target x86_64-unknown-uefi
- name: Run tests
run: cargo test --verbose --all-features
integration_test:
runs-on: ubuntu-latest
name: Integration Test
steps:
- uses: actions/checkout@v6
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
key: "integration-test"
cache-directories:
./integration-test/x86/target
./integration-test/riscv/target
- name: Install integration-test dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
make \
qemu-system-misc \
qemu-system-x86
- name: Verify QEMU installation
run: |
qemu-system-i386 --version
qemu-system-riscv64 --version
- name: Build
working-directory: integration-test
run: make
- name: Run
working-directory: integration-test
run: make run
miri:
runs-on: ubuntu-latest
needs:
# Logical dependency and wait for cache to be present
- build
strategy:
matrix:
rust:
- nightly
steps:
- uses: actions/checkout@v6
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "${{ matrix.rust }}"
- uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.rust }}"
- run: rustup component add miri
- run: cargo miri test --tests
# Style + documentation checks
style_checks:
runs-on: "${{ matrix.runs-on }}"
strategy:
matrix:
runs-on:
- macos-latest # aarch64
- ubuntu-latest # x86_64
- windows-latest # x86_64
rust:
- stable
steps:
- uses: actions/checkout@v6
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "${{ matrix.rust }}"
- uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.rust }}"
- name: Rustfmt
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets
- name: Rustdoc
run: cargo doc --no-deps --document-private-items
- name: Rustdoc (doc_cfg + nightly)
env:
RUSTDOCFLAGS: --cfg docsrs
run: cargo +nightly doc --no-deps --document-private-items