@@ -23,106 +23,166 @@ jobs:
23
23
# Check
24
24
25
25
check :
26
- name : Check
26
+ name : Check (${{ matrix.platform.target }})
27
27
strategy :
28
28
fail-fast : false
29
29
matrix :
30
30
platform :
31
31
- os : " macos-12"
32
32
target : " x86_64-apple-darwin"
33
+ arch : " x86_64"
33
34
- os : " ubuntu-22.04"
34
35
target : " x86_64-unknown-linux-gnu"
36
+ arch : " x86_64"
35
37
- os : " ubuntu-22.04"
36
38
target : " x86_64-unknown-linux-musl"
39
+ arch : " x86_64"
37
40
- os : " windows-2022"
38
41
target : " x86_64-pc-windows-msvc"
42
+ arch : " x86_64"
43
+ - os : " ubuntu-22.04"
44
+ target : " aarch64-unknown-linux-gnu"
45
+ arch : " arm64"
46
+ features : " --features=raspberry"
47
+ - os : " ubuntu-22.04"
48
+ target : " armv7-unknown-linux-gnueabihf"
49
+ arch : " armhf"
50
+ features : " --features=raspberry"
39
51
runs-on : ${{ matrix.platform.os }}
40
52
41
53
steps :
42
- - name : Install dependencies
43
- if : matrix.platform.os == 'ubuntu-22.04'
44
- run : sudo apt-get install musl-tools libudev-dev
45
54
46
- - uses : actions/checkout@v3
47
- - uses : dtolnay/rust-toolchain@stable
55
+ - uses : actions/checkout@v4
56
+
57
+ - uses : ./.github/actions/setup-target
48
58
with :
49
- targets : ${{ matrix.platform.target }}
50
- - uses : Swatinem/rust-cache@v2
59
+ arch : ${{ matrix.platform.arch }}
60
+ target : ${{ matrix.platform.target }}
51
61
52
- - run : cargo check
62
+ - run : cargo check ${{ matrix.platform.features }}
53
63
54
64
check-lib :
55
- name : Check (lib)
65
+ name : Check lib (${{ matrix.platform.target }})
66
+ strategy :
67
+ fail-fast : false
68
+ matrix :
69
+ platform :
70
+ - target : " x86_64-unknown-linux-gnu"
71
+ arch : " x86_64"
72
+ - target : " aarch64-unknown-linux-gnu"
73
+ arch : " arm64"
74
+ features : " --features=raspberry"
75
+ - target : " armv7-unknown-linux-gnueabihf"
76
+ arch : " armhf"
77
+ features : " --features=raspberry"
56
78
runs-on : ubuntu-22.04
57
79
58
80
steps :
59
- - name : Install dependencies
60
- run : sudo apt-get install musl-tools libudev-dev
61
81
62
- - uses : actions/checkout@v3
63
- - uses : dtolnay/rust-toolchain@stable
64
- - uses : Swatinem/rust-cache@v2
82
+ - uses : actions/checkout@v4
83
+
84
+ - uses : ./.github/actions/setup-target
85
+ with :
86
+ arch : ${{ matrix.platform.arch }}
87
+ target : ${{ matrix.platform.target }}
65
88
66
- - run : cargo check --lib --no-default-features
89
+ - run : cargo check --lib --no-default-features ${{ matrix.platform.features }}
67
90
68
91
msrv :
69
- name : Check MSRV
92
+ name : Check MSRV (${{ matrix.platform.target }})
93
+ strategy :
94
+ fail-fast : false
95
+ matrix :
96
+ platform :
97
+ - target : " x86_64-unknown-linux-gnu"
98
+ arch : " x86_64"
99
+ - target : " aarch64-unknown-linux-gnu"
100
+ arch : " arm64"
101
+ features : " --features=raspberry"
102
+ - target : " armv7-unknown-linux-gnueabihf"
103
+ arch : " armhf"
104
+ features : " --features=raspberry"
70
105
runs-on : ubuntu-22.04
71
106
72
107
steps :
73
- - name : Install dependencies
74
- run : sudo apt-get install musl-tools libudev-dev
75
108
76
- - uses : actions/checkout@v3
77
- - uses : dtolnay/rust-toolchain@v1
109
+ - uses : actions/checkout@v4
110
+
111
+ - uses : ./.github/actions/setup-target
78
112
with :
113
+ arch : ${{ matrix.platform.arch }}
114
+ target : ${{ matrix.platform.target }}
79
115
toolchain : " 1.65"
80
- - uses : Swatinem/rust-cache@v2
81
116
82
- - run : cargo check
117
+ - run : cargo check ${{ matrix.platform.features }}
83
118
84
119
# --------------------------------------------------------------------------
85
120
# Test
86
121
87
122
test :
88
- name : Unit Tests
123
+ name : Unit Tests (${{ matrix.platform.target }})
124
+ strategy :
125
+ fail-fast : false
126
+ matrix :
127
+ platform :
128
+ - target : " x86_64-unknown-linux-gnu"
129
+ arch : " x86_64"
130
+ - target : " aarch64-unknown-linux-gnu"
131
+ arch : " arm64"
132
+ features : " --features=raspberry"
133
+ - target : " armv7-unknown-linux-gnueabihf"
134
+ arch : " armhf"
135
+ features : " --features=raspberry"
89
136
runs-on : ubuntu-22.04
90
137
91
138
steps :
92
- - name : Install dependencies
93
- run : sudo apt-get install musl-tools libudev-dev
94
139
95
- - uses : actions/checkout@v3
96
- - uses : dtolnay/rust-toolchain@stable
97
- - uses : Swatinem/rust-cache@v2
140
+ - uses : actions/checkout@v4
98
141
99
- - run : cargo test --lib
142
+ - uses : ./.github/actions/setup-target
143
+ with :
144
+ arch : ${{ matrix.platform.arch }}
145
+ target : ${{ matrix.platform.target }}
146
+
147
+ - run : cargo test --lib ${{ matrix.platform.features }}
100
148
101
149
# --------------------------------------------------------------------------
102
150
# Lint
103
151
104
152
clippy :
105
- name : Clippy
153
+ name : Clippy (${{ matrix.platform.target }})
154
+ strategy :
155
+ fail-fast : false
156
+ matrix :
157
+ platform :
158
+ - target : " x86_64-unknown-linux-gnu"
159
+ arch : " x86_64"
160
+ - target : " aarch64-unknown-linux-gnu"
161
+ arch : " arm64"
162
+ features : " --features=raspberry"
163
+ - target : " armv7-unknown-linux-gnueabihf"
164
+ arch : " armhf"
165
+ features : " --features=raspberry"
106
166
runs-on : ubuntu-22.04
107
167
108
168
steps :
109
- - name : Install dependencies
110
- run : sudo apt-get install musl-tools libudev-dev
111
169
112
- - uses : actions/checkout@v3
113
- - uses : dtolnay/rust-toolchain@stable
170
+ - uses : actions/checkout@v4
171
+
172
+ - uses : ./.github/actions/setup-target
114
173
with :
174
+ arch : ${{ matrix.platform.arch }}
175
+ target : ${{ matrix.platform.target }}
115
176
components : clippy
116
- - uses : Swatinem/rust-cache@v2
117
177
118
- - run : cargo clippy -- -D warnings -A clippy::too_many_arguments
178
+ - run : cargo clippy ${{ matrix.platform.features }} -- -D warnings -A clippy::too_many_arguments
119
179
120
180
rustfmt :
121
181
name : Rustfmt
122
182
runs-on : ubuntu-22.04
123
183
124
184
steps :
125
- - uses : actions/checkout@v3
185
+ - uses : actions/checkout@v4
126
186
- uses : dtolnay/rust-toolchain@stable
127
187
with :
128
188
components : rustfmt
0 commit comments