-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (69 loc) · 2.36 KB
/
build.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
name: Rust
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
feature-args:
- ''
- --no-default-features --features alloc
- --no-default-features --features serde
- --no-default-features
steps:
- uses: actions/checkout@v4
- name: Install libudev
run: sudo apt-get update && sudo apt-get install -y libudev-dev
- name: Install MSRV
uses: actions-rs/toolchain@v1
with:
toolchain: 1.65.0
override: true
components: rustfmt, clippy
- name: Build
run: cargo build --verbose ${{ matrix.feature-args }}
- name: Run tests
run: cargo test --verbose ${{ matrix.feature-args }}
- name: Coding style
run: |
cargo fmt --all -- --check
cargo clippy --all-features --all-targets -- -D warnings
build_embedded:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install MSRV
uses: actions-rs/toolchain@v1
with:
toolchain: 1.70.0
override: true
- name: Install embedded targets
run: rustup target add thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabihf
- name: Build
run: cargo build --verbose --no-default-features --target thumbv6m-none-eabi --target thumbv7m-none-eabi --target thumbv7em-none-eabihf
- name: Build (alloc)
run: cargo build --verbose --no-default-features --target thumbv6m-none-eabi --target thumbv7m-none-eabi --target thumbv7em-none-eabihf --features alloc
- name: Build (serde)
run: cargo build --verbose --no-default-features --target thumbv6m-none-eabi --target thumbv7m-none-eabi --target thumbv7em-none-eabihf --features serde
build_examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install libudev
run: sudo apt-get update && sudo apt-get install -y libudev-dev
- name: Install MSRV
uses: actions-rs/toolchain@v1
with:
toolchain: 1.70.0
override: true
components: rustfmt, clippy
- name: Build
run: cd ${{ github.workspace }}/examples && cargo build
- name: Coding style
run: |
cd ${{ github.workspace }}/examples && cargo fmt --all -- --check
cd ${{ github.workspace }}/examples && cargo clippy --all-features --all-targets -- -D warnings