9
9
ci :
10
10
name : CI
11
11
runs-on : ubuntu-latest
12
- needs : [ci-linux]
13
- steps :
12
+ needs : [check, ci-linux, ci-clippy, ci-serde ]
13
+ steps :
14
14
- name : Done
15
15
run : exit 0
16
+
17
+ check :
18
+ name : Cargo check
19
+ runs-on : ubuntu-latest
20
+ strategy :
21
+ matrix :
22
+ TARGET : [x86_64-unknown-linux-gnu, x86_64-apple-darwin, x86_64-pc-windows-msvc]
23
+
24
+ steps :
25
+ - uses : actions/checkout@v3
26
+
27
+ - uses : actions-rs/toolchain@v1
28
+ with :
29
+ profile : minimal
30
+ toolchain : stable
31
+ override : true
32
+ target : ${{ matrix.TARGET }}
33
+
34
+ - name : Cache Dependencies
35
+ uses : Swatinem/rust-cache@v1
36
+ with :
37
+ key : ${{ matrix.TARGET }}
38
+
39
+ - uses : actions-rs/cargo@v1
40
+ with :
41
+ command : check
42
+ args : --target ${{ matrix.TARGET }}
43
+
44
+ prebuild :
45
+ name : Prebuild
46
+ runs-on : ubuntu-latest
47
+ strategy :
48
+ matrix :
49
+ rust : [stable, nightly, 1.46.0]
50
+
51
+ steps :
52
+ - uses : actions/checkout@v3
53
+
54
+ - uses : actions-rs/toolchain@v1
55
+ with :
56
+ profile : minimal
57
+ toolchain : ${{ matrix.rust }}
58
+ override : true
59
+
60
+ - name : Cache
61
+ uses : Swatinem/rust-cache@v1
62
+ with :
63
+ sharedKey : prebuilded-${{ matrix.rust }}
64
+
65
+ - name : Self install
66
+ run : |
67
+ cargo install svd2rust --path .
68
+
16
69
ci-linux :
17
70
runs-on : ubuntu-latest
71
+ needs : [check, prebuild]
18
72
strategy :
19
- fail-fast : false
20
73
matrix :
21
74
# All generated code should be running on stable now
22
75
rust : [stable]
23
76
24
77
# All vendor files we want to test on stable
25
- vendor : [rustfmt, Atmel, Freescale, Fujitsu, Holtek, Microchip, Nordic, Nuvoton, NXP, RISC-V, SiliconLabs, Spansion, STMicro, Toshiba]
26
-
27
- # The default target we're compiling on and for
28
- TARGET : [x86_64-unknown-linux-gnu]
29
-
30
- # Temporary hack as long as we use the current CI script
31
- TRAVIS_OS_NAME : [linux]
32
-
33
- FEATURES : [""]
78
+ vendor : [Atmel, Freescale, Fujitsu, Holtek, Microchip, Nordic, Nuvoton, NXP, RISC-V, SiliconLabs, Spansion, STMicro, Toshiba]
34
79
35
80
# Options are all, none, strict and const
36
81
options : [all, none]
@@ -51,68 +96,103 @@ jobs:
51
96
# Test MSRV
52
97
- rust : 1.46.0
53
98
vendor : Nordic
54
- TARGET : x86_64-unknown-linux-gnu
55
- TRAVIS_OS_NAME : linux
56
99
57
100
# Use nightly for architectures which don't support stable
58
101
- rust : nightly
59
- experimental : true
60
102
vendor : OTHER
61
- TARGET : x86_64-unknown-linux-gnu
62
- TRAVIS_OS_NAME : linux
63
103
64
- # Use nightly for architectures which don't support stable
104
+ # Use nightly for architectures which don't support stable
65
105
- rust : nightly
66
- experimental : true
67
106
vendor : Espressif
68
- TARGET : x86_64-unknown-linux-gnu
69
- TRAVIS_OS_NAME : linux
70
-
71
- # OSX
72
- - rust : stable
73
- TARGET : x86_64-apple-darwin
74
- TRAVIS_OS_NAME : osx
75
-
76
- # Windows
77
- - rust : stable
78
- TARGET : x86_64-pc-windows-msvc
79
- TRAVIS_OS_NAME : windows
80
107
81
108
steps :
82
- - uses : actions/checkout@v2
109
+ - uses : actions/checkout@v3
110
+
83
111
- uses : actions-rs/toolchain@v1
84
112
with :
85
113
profile : minimal
86
114
toolchain : ${{ matrix.rust }}
87
- target : ${{ matrix.TARGET }}
88
115
override : true
89
- components : rustfmt
116
+
117
+ - name : Cache
118
+ uses : Swatinem/rust-cache@v1
119
+ with :
120
+ sharedKey : prebuilded-${{ matrix.rust }}
121
+
90
122
- name : Run CI script for `${{ matrix.vendor }}` under rust `${{ matrix.rust }}` with options=`${{ matrix.options }}`
91
123
env :
92
- TARGET : ${{ matrix.TARGET }}
93
124
VENDOR : ${{ matrix.vendor }}
94
- FEATURES : ${{ matrix.FEATURES }}
95
- OPTIONS : ${{ matrix.options }}
96
- TRAVIS_OS_NAME : ${{ matrix.TRAVIS_OS_NAME }}
125
+ OPTIONS : ${{ matrix.options }}
126
+ COMMAND : check
97
127
run : bash ci/script.sh
128
+
129
+ ci-clippy :
130
+ runs-on : ubuntu-latest
131
+ needs : [check, prebuild]
132
+ steps :
133
+ - uses : actions/checkout@v3
134
+
135
+ - uses : actions-rs/toolchain@v1
136
+ with :
137
+ profile : minimal
138
+ toolchain : stable
139
+ override : true
140
+
141
+ - name : Cache
142
+ uses : Swatinem/rust-cache@v1
143
+ with :
144
+ sharedKey : prebuilded-stable
145
+
146
+ - name : Run CI script
147
+ env :
148
+ VENDOR : RISC-V
149
+ OPTIONS : all
150
+ COMMAND : clippy
151
+ run : bash ci/script.sh
152
+
98
153
ci-serde :
99
154
runs-on : ubuntu-latest
100
155
steps :
101
- - uses : actions/checkout@v2
156
+ - uses : actions/checkout@v3
157
+
102
158
- uses : actions-rs/toolchain@v1
103
159
with :
104
160
profile : minimal
105
161
toolchain : stable
106
162
override : true
107
- components : rustfmt
108
- - name : Install svdtools
109
- uses :
actions-rs/[email protected]
163
+
164
+ - name : Cache
165
+ uses : Swatinem/rust-cache@v1
110
166
with :
111
- crate : svdtools
112
- version : 0.2.0
113
- use-tool-cache : true
167
+ key : svdtools-0.2.1
168
+
169
+ - name : Install svdtools
170
+ run : |
171
+ cargo install svdtools --version 0.2.1 --target-dir target
172
+
114
173
- name : Run CI script
115
174
run : |
116
175
wget https://stm32-rs.github.io/stm32-rs/stm32f411.svd.patched
117
176
svdtools convert --input-format xml stm32f411.svd.patched stm32f411.yaml
118
177
cargo run --release -- -i stm32f411.yaml
178
+
179
+ fmt :
180
+ name : Rustfmt
181
+ runs-on : ubuntu-latest
182
+ steps :
183
+ - uses : actions/checkout@v3
184
+
185
+ - uses : actions-rs/toolchain@v1
186
+ with :
187
+ profile : minimal
188
+ toolchain : stable
189
+ override : true
190
+ components : rustfmt
191
+
192
+ - name : Cache Dependencies
193
+ uses : Swatinem/rust-cache@v1
194
+
195
+ - uses : actions-rs/cargo@v1
196
+ with :
197
+ command : fmt
198
+ args : --all -- --check
0 commit comments