@@ -10,72 +10,87 @@ defaults:
10
10
run :
11
11
shell : bash
12
12
13
+ concurrency :
14
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15
+ cancel-in-progress : true
16
+
13
17
jobs :
14
- rustfmt :
15
- name : rustfmt
18
+ build :
19
+ name : Build
16
20
runs-on : ubuntu-latest
17
21
steps :
18
22
- name : Checkout source code
19
- uses : actions/checkout@v2
20
-
21
- - name : Install Rust
22
- uses : actions-rs/toolchain@v1
23
- with :
24
- profile : minimal
25
- toolchain : nightly
26
- override : true
27
- components : rustfmt
28
-
29
- - name : Run rustfmt
30
- uses : actions-rs/cargo@v1
31
- with :
32
- command : fmt
33
- args : --all -- --check --verbose
23
+ uses : actions/checkout@v4
34
24
35
- clippy :
36
- name : clippy
37
- runs-on : ubuntu-latest
38
- steps :
39
- - name : Checkout source code
40
- uses : actions/checkout@v2
41
-
42
- - name : Install Rust
43
- uses : actions-rs/toolchain@v1
44
- with :
45
- profile : minimal
46
- toolchain : stable
47
- override : true
48
- components : clippy
49
-
50
- - name : Run clippy
51
- uses : actions-rs/clippy-check@v1
52
- with :
53
- token : ${{ secrets.GITHUB_TOKEN }}
54
- args : --features odin-w2xx,ppp
25
+ - uses : dsherret/rust-toolchain-file@v1
26
+
27
+ - name : Build (library)
28
+ run : cargo build --all --target thumbv7em-none-eabihf --features "odin-w2xx,ppp"
29
+
30
+ # - name: Build (examples)
31
+ # run: |
32
+ # for EXAMPLE in $(ls examples);
33
+ # do
34
+ # (cd examples/$EXAMPLE && cargo build)
35
+ # done
55
36
56
37
test :
57
38
name : Test
58
39
runs-on : ubuntu-latest
59
40
steps :
60
41
- name : Checkout source code
61
- uses : actions/checkout@v2
62
-
63
- - name : Install Rust
64
- uses : actions-rs/toolchain@v1
65
- with :
66
- profile : minimal
67
- toolchain : stable
68
- target : thumbv7m-none-eabi
69
- override : true
70
-
71
- - name : Build
72
- uses : actions-rs/cargo@v1
73
- with :
74
- command : build
75
- args : --all --target thumbv7m-none-eabi --features odin-w2xx,ppp
42
+ uses : actions/checkout@v4
43
+
44
+ - uses : dsherret/rust-toolchain-file@v1
76
45
77
46
- name : Test
78
- uses : actions-rs/cargo@v1
79
- with :
80
- command : test
81
- args : --lib --features odin-w2xx,ppp
47
+ run : cargo test --features "odin-w2xx,ppp"
48
+
49
+ - name : Install Miri
50
+ run : |
51
+ rustup toolchain install nightly --component miri
52
+ rustup override set nightly
53
+ cargo miri setup
54
+
55
+ - name : Test (Miri)
56
+ run : cargo miri test --lib --features "odin-w2xx,ppp"
57
+
58
+ rustfmt :
59
+ name : Rustfmt
60
+ runs-on : ubuntu-latest
61
+ steps :
62
+ - name : Checkout source code
63
+
64
+ uses : actions/checkout@v4
65
+ - uses : dsherret/rust-toolchain-file@v1
66
+
67
+ - name : Run rustfmt (library)
68
+ run : cargo fmt --all -- --check --verbose
69
+
70
+ - name : Run rustfmt (examples)
71
+ run : |
72
+ for EXAMPLE in $(ls examples);
73
+ do
74
+ (cd examples/$EXAMPLE && cargo fmt --all -- --check --verbose)
75
+ done
76
+
77
+ clippy :
78
+ name : Clippy
79
+ runs-on : ubuntu-latest
80
+ env :
81
+ CLIPPY_PARAMS : -W clippy::all -W clippy::pedantic -W clippy::nursery -W clippy::cargo
82
+ steps :
83
+ - name : Checkout source code
84
+
85
+ uses : actions/checkout@v4
86
+ - uses : dsherret/rust-toolchain-file@v1
87
+
88
+ - name : Run clippy (library)
89
+ run : cargo clippy --features "odin-w2xx,ppp" -- ${{ env.CLIPPY_PARAMS }}
90
+
91
+ # - name: Run clippy (examples)
92
+ # run: |
93
+ # for EXAMPLE in $(ls examples);
94
+ # do
95
+ # (cd examples/$EXAMPLE && cargo clippy -- ${{ env.CLIPPY_PARAMS }})
96
+ # done
0 commit comments