-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (66 loc) · 1.98 KB
/
build.yaml
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
name: Build and Test
on:
push:
pull_request:
branches: [main]
types: [opened, reopened]
workflow_dispatch:
concurrency:
group: rust-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy -- -D warnings
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
build:
runs-on: ubuntu-latest
strategy:
matrix:
feature-args:
- --features "alloc std ubx_series8" # - --all-features
- --no-default-features --features "alloc ubx_series8"
- --no-default-features --features ubx_series8
- --no-default-features --features ubx_series9
steps:
- uses: actions/checkout@v4
- name: Setup toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Build
run: cargo build ${{ matrix.feature-args }} --verbose
- name: Test
run: cargo test ${{ matrix.feature-args }} -- --nocapture
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: Setup toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Build
run: cd ${{ github.workspace }}/examples && cargo build --release
- name: Coding style
run: |
cd ${{ github.workspace }}/examples && cargo fmt --all -- --check
cd ${{ github.workspace }}/examples && cargo clippy --all-features --all-targets -- -D warnings