-
Notifications
You must be signed in to change notification settings - Fork 9
40 lines (37 loc) · 1.11 KB
/
ci.yml
File metadata and controls
40 lines (37 loc) · 1.11 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
name: Check, Build and Test
on:
push:
pull_request:
branches:
- main
jobs:
ci:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-toolchain: [stable]
targets: [x86_64-unknown-linux-gnu]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: ${{ matrix.rust-toolchain }}
components: clippy, rustfmt
targets: ${{ matrix.targets }}
- uses: Swatinem/rust-cache@v2
- name: Install qemu
run: sudo apt install qemu-system-aarch64 -y
- name: Install lib libudev-dev
run: sudo apt install libudev-dev -y
- name: Check rust version
run: rustc --version --verbose
- name: Check code format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --target ${{ matrix.targets }} --all-features
- name: Build
run: cargo build --target ${{ matrix.targets }} --all-features
- name: Unit test
if: ${{ matrix.targets == 'x86_64-unknown-linux-gnu' }}
run: cargo test --target ${{ matrix.targets }} -- --nocapture