Skip to content

Commit 0057740

Browse files
committed
ci: update to dtolnay/rust-toolchain
1 parent 275ed61 commit 0057740

File tree

1 file changed

+52
-127
lines changed

1 file changed

+52
-127
lines changed

.github/workflows/ci.yml

+52-127
Original file line numberDiff line numberDiff line change
@@ -13,43 +13,29 @@ jobs:
1313
runs-on: ubuntu-22.04
1414

1515
steps:
16-
- name: install stable toolchain with rustfmt
17-
uses: actions-rs/toolchain@v1
16+
- name: Install Rust toolchain
17+
uses: dtolnay/rust-toolchain@stable
1818
with:
19-
profile: minimal
20-
toolchain: stable
2119
components: rustfmt
2220
- uses: actions/checkout@v1
2321
- name: rustfmt check
24-
uses: actions-rs/cargo@v1
25-
with:
26-
command: fmt
27-
args: -- --check
22+
run: cargo fmt --check
2823

2924
xen:
3025
runs-on: ubuntu-22.04
3126

3227
steps:
3328
- name: install Xen headers and libraries
3429
run: sudo apt-get install -y libxen-dev
35-
- name: install stable toolchain with clippy
36-
uses: actions-rs/toolchain@v1
30+
- name: Install Rust toolchain
31+
uses: dtolnay/rust-toolchain@stable
3732
with:
38-
profile: minimal
39-
toolchain: stable
4033
components: clippy
4134
- uses: actions/checkout@v1
42-
- name: build Xen driver
43-
uses: actions-rs/cargo@v1
44-
with:
45-
command: build
46-
args: --features xen
47-
- name: annotate commit with clippy warnings
48-
uses: actions-rs/clippy-check@v1
49-
with:
50-
name: clippy xen
51-
token: ${{ secrets.GITHUB_TOKEN }}
52-
args: --features xen -- -D warnings
35+
- name: build and check Xen driver
36+
run: |
37+
cargo build --features xen
38+
cargo clippy --features xen -- -D warnings
5339
5440
kvm:
5541
runs-on: ubuntu-22.04
@@ -70,35 +56,20 @@ jobs:
7056
sudo make install
7157
working-directory: libkvmi
7258

73-
- name: install stable toolchain with clippy
74-
uses: actions-rs/toolchain@v1
59+
- name: Install Rust toolchain
60+
uses: dtolnay/rust-toolchain@stable
7561
with:
76-
profile: minimal
77-
toolchain: stable
7862
components: clippy
7963
- uses: actions/checkout@v1
80-
- name: build KVM driver
81-
uses: actions-rs/cargo@v1
82-
with:
83-
command: build
84-
args: --features kvm
85-
- name: annotate commit with clippy warnings
86-
uses: actions-rs/clippy-check@v1
87-
with:
88-
name: clippy kvm
89-
token: ${{ secrets.GITHUB_TOKEN }}
90-
args: --features kvm -- -D warnings
91-
- name: remove compilation artifacts from stable toolchain
92-
uses: actions-rs/cargo@v1
93-
with:
94-
command: clean
64+
- name: build and check KVM driver
65+
run: |
66+
cargo build --features kvm
67+
cargo clippy --features kvm -- -D warnings
68+
- name: remove compilation artifacts
69+
run: cargo clean
9570

9671
- name: test KVM driver
97-
uses: actions-rs/cargo@v1
98-
with:
99-
command: test
100-
# --lib only unit tests in the library, avoid integration tests
101-
args: --lib --features kvm
72+
run: cargo test --lib --features kvm
10273
env:
10374
RUSTFLAGS: "-Cinstrument-coverage"
10475
LLVM_PROFILE_FILE: "coverage-%p-%m.profraw"
@@ -128,24 +99,15 @@ jobs:
12899
os: [ ubuntu-22.04, windows-2022 ]
129100

130101
steps:
131-
- name: install stable toolchain with clippy
132-
uses: actions-rs/toolchain@v1
102+
- name: Install Rust toolchain
103+
uses: dtolnay/rust-toolchain@stable
133104
with:
134-
profile: minimal
135-
toolchain: stable
136105
components: clippy
137106
- uses: actions/checkout@v1
138-
- name: build Memflow driver
139-
uses: actions-rs/cargo@v1
140-
with:
141-
command: build
142-
args: --features mflow
143-
- name: annotate commit with clippy warnings
144-
uses: actions-rs/clippy-check@v1
145-
with:
146-
name: clippy memflow
147-
token: ${{ secrets.GITHUB_TOKEN }}
148-
args: --features mflow -- -D warnings
107+
- name: build and check Memflow driver
108+
run: |
109+
cargo build --features mflow
110+
cargo clippy --features mflow -- -D warnings
149111
150112
virtualbox_linux:
151113
runs-on: ubuntu-22.04
@@ -159,34 +121,23 @@ jobs:
159121
g++ -std=c++11 -shared -fPIC FDP.cpp -o libFDP.so -lrt
160122
sudo cp include/* /usr/local/include
161123
sudo cp libFDP.so /usr/local/lib
162-
- name: install stable toolchain with clippy
163-
uses: actions-rs/toolchain@v1
124+
- name: Install Rust toolchain
125+
uses: dtolnay/rust-toolchain@stable
164126
with:
165-
profile: minimal
166-
toolchain: stable
167127
components: clippy
168128
- uses: actions/checkout@v1
169-
- name: build VirtualBox driver
170-
uses: actions-rs/cargo@v1
171-
with:
172-
command: build
173-
args: --features virtualbox
174-
- name: annotate commit with clippy warnings
175-
uses: actions-rs/clippy-check@v1
176-
with:
177-
name: clippy virtualbox
178-
token: ${{ secrets.GITHUB_TOKEN }}
179-
args: --features virtualbox -- -D warnings
129+
- name: build and check VirtualBox driver
130+
run: |
131+
cargo build --features virtualbox
132+
cargo clippy --features virtualbox -- -D warnings
180133
181134
virtualbox_windows:
182135
runs-on: windows-2022
183136

184137
steps:
185-
- name: install stable toolchain with clippy
186-
uses: actions-rs/toolchain@v1
138+
- name: Install Rust toolchain
139+
uses: dtolnay/rust-toolchain@stable
187140
with:
188-
profile: minimal
189-
toolchain: stable
190141
components: clippy
191142

192143
- name: Clone Icebox repository
@@ -220,10 +171,7 @@ jobs:
220171
run: choco install llvm
221172

222173
- name: build VirtualBox driver
223-
uses: actions-rs/cargo@v1
224-
with:
225-
command: build
226-
args: --manifest-path libmicrovmi/Cargo.toml --features virtualbox
174+
run: cargo build --manifest-path libmicrovmi/Cargo.toml --features virtualbox
227175
env:
228176
BINDGEN_EXTRA_CLANG_ARGS: -I"C:\FDP" -L"C:\FDP"
229177
CARGO_BUILD_RUSTFLAGS: -L C:\FDP
@@ -235,18 +183,13 @@ jobs:
235183
os: [ubuntu-22.04, windows-2022]
236184

237185
steps:
238-
- name: install stable toolchain
239-
uses: actions-rs/toolchain@v1
240-
with:
241-
profile: minimal
242-
toolchain: stable
186+
- name: Install Rust toolchain
187+
uses: dtolnay/rust-toolchain@stable
243188

244189
- uses: actions/checkout@v1
245190

246191
- name: build libmicrovmi
247-
uses: actions-rs/cargo@v1
248-
with:
249-
command: build
192+
run: cargo build
250193

251194
- name: build C API
252195
run: |
@@ -260,32 +203,24 @@ jobs:
260203
matrix:
261204
os: [ubuntu-22.04, windows-2022]
262205
steps:
263-
- name: install stable toolchain with clippy
264-
uses: actions-rs/toolchain@v1
206+
- name: Install Rust toolchain
207+
uses: dtolnay/rust-toolchain@stable
265208
with:
266-
profile: minimal
267-
toolchain: stable
268209
components: clippy
269210

270211
- uses: actions/checkout@v1
271212

272-
- name: build examples with clippy
273-
uses: actions-rs/clippy-check@v1
274-
with:
275-
name: clippy examples
276-
token: ${{ secrets.GITHUB_TOKEN }}
277-
args: --examples -- -D warnings
213+
- name: check examples with clippy
214+
run: cargo clippy --examples -- -D warnings
278215

279216
release_python:
280217
# build a libmicrovmi python bindings release
281218
# and upload it as artifact
282219
runs-on: ubuntu-22.04
283220
steps:
284-
- name: install stable toolchain with clippy
285-
uses: actions-rs/toolchain@v1
221+
- name: Install Rust toolchain
222+
uses: dtolnay/rust-toolchain@stable
286223
with:
287-
profile: minimal
288-
toolchain: stable
289224
components: clippy
290225

291226
- name: Set up Python 3.8 🐍
@@ -301,18 +236,10 @@ jobs:
301236
nox -r
302237
working-directory: python
303238

304-
- name: build Python extension
305-
uses: actions-rs/cargo@v1
306-
with:
307-
command: build
308-
args: -p pymicrovmi
309-
310-
- name: annotate commit with clippy warnings
311-
uses: actions-rs/clippy-check@v1
312-
with:
313-
name: clippy python
314-
token: ${{ secrets.GITHUB_TOKEN }}
315-
args: -p pymicrovmi -- -D warnings
239+
- name: build Python extension and check with clippy
240+
run: |
241+
cargo build -p pymicrovmi
242+
cargo clippy -p pymicrovmi -- -D warnings
316243
317244
- name: install Python package
318245
run: |
@@ -407,11 +334,9 @@ jobs:
407334
needs: [virtualbox_windows, memflow]
408335
runs-on: windows-2022
409336
steps:
410-
- name: install stable toolchain with clippy
411-
uses: actions-rs/toolchain@v1
337+
- name: Install Rust toolchain
338+
uses: dtolnay/rust-toolchain@stable
412339
with:
413-
profile: minimal
414-
toolchain: stable
415340
components: clippy
416341

417342
- name: Clone Icebox repository
@@ -445,10 +370,7 @@ jobs:
445370
run: choco install llvm
446371

447372
- name: build libmicrovmi with virtualbox and memflow driver
448-
uses: actions-rs/cargo@v1
449-
with:
450-
command: build
451-
args: --manifest-path libmicrovmi/Cargo.toml --features virtualbox,mflow --release
373+
run: cargo build --manifest-path libmicrovmi/Cargo.toml --features virtualbox,mflow --release
452374
env:
453375
BINDGEN_EXTRA_CLANG_ARGS: -I"C:\FDP" -L"C:\FDP"
454376
CARGO_BUILD_RUSTFLAGS: -L C:\FDP
@@ -605,6 +527,9 @@ jobs:
605527

606528
- uses: actions/checkout@v1
607529

530+
- name: Install Rust toolchain
531+
uses: dtolnay/rust-toolchain@stable
532+
608533
- name: Publish
609534
shell: bash
610535
run: |

0 commit comments

Comments
 (0)