-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (76 loc) · 2.24 KB
/
ci.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: CI
on:
push:
branches:
- master
pull_request:
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- uses: dsherret/rust-toolchain-file@v1
- name: Build (library)
run: cargo build --all --target thumbv7em-none-eabihf --features "odin-w2xx,ppp"
# - name: Build (examples)
# run: |
# for EXAMPLE in $(ls examples);
# do
# (cd examples/$EXAMPLE && cargo build)
# done
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- uses: dsherret/rust-toolchain-file@v1
- name: Test
run: cargo test --features "odin-w2xx,ppp"
- name: Install Miri
run: |
rustup toolchain install nightly --component miri
rustup override set nightly
cargo miri setup
- name: Test (Miri)
run: cargo miri test --lib --features "odin-w2xx,ppp"
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- uses: dsherret/rust-toolchain-file@v1
- name: Run rustfmt (library)
run: cargo fmt --all -- --check --verbose
- name: Run rustfmt (examples)
run: |
for EXAMPLE in $(ls examples);
do
(cd examples/$EXAMPLE && cargo fmt --all -- --check --verbose)
done
clippy:
name: Clippy
runs-on: ubuntu-latest
env:
CLIPPY_PARAMS: -W clippy::all -W clippy::pedantic -W clippy::nursery -W clippy::cargo
steps:
- name: Checkout source code
uses: actions/checkout@v4
- uses: dsherret/rust-toolchain-file@v1
- name: Run clippy (library)
run: cargo clippy --features "odin-w2xx,ppp" -- ${{ env.CLIPPY_PARAMS }}
# - name: Run clippy (examples)
# run: |
# for EXAMPLE in $(ls examples);
# do
# (cd examples/$EXAMPLE && cargo clippy -- ${{ env.CLIPPY_PARAMS }})
# done