File tree Expand file tree Collapse file tree 2 files changed +56
-12
lines changed Expand file tree Collapse file tree 2 files changed +56
-12
lines changed Original file line number Diff line number Diff line change 3
3
- stable
4
4
- nightly
5
5
cache : cargo
6
+
6
7
env :
7
- - MCU=stm32f042
8
- - MCU=stm32f030
9
- - MCU=stm32f030x6
10
- - MCU=stm32f030x8
11
- - MCU=stm32f030xc
12
- - MCU=stm32f070
13
- - MCU=stm32f070x6
14
- - MCU=stm32f070xb
15
- - MCU=stm32f072
16
- - MCU=stm32f091
8
+ - COMMAND=""
9
+ - COMMAND=size_check
10
+
17
11
matrix :
18
12
allow_failures :
19
13
- rust : nightly
14
+ - env : COMMAND=size_check
20
15
fast_finish : true
21
- script :
16
+
17
+ install :
22
18
- rustup target add thumbv6m-none-eabi
23
- - cargo build --features=$MCU --examples --release
19
+
20
+ script : tools/check.py $COMMAND
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env python3
2
+
3
+ import json
4
+ import subprocess
5
+ import sys
6
+
7
+
8
+ def run_inner (args ):
9
+ print ("Running `{}`..." .format (" " .join (args )))
10
+ ret = subprocess .call (args ) == 0
11
+ print ("" )
12
+ return ret
13
+
14
+
15
+ def run (mcu , cargo_cmd ):
16
+ if mcu == "" :
17
+ return run_inner (cargo_cmd )
18
+ else :
19
+ return run_inner (cargo_cmd + ["--examples" , "--features={}" .format (mcu )])
20
+
21
+
22
+ def main ():
23
+ cargo_meta = json .loads (
24
+ subprocess .check_output ("cargo metadata --no-deps --format-version=1" ,
25
+ shell = True ,
26
+ universal_newlines = True )
27
+ )
28
+
29
+ crate_info = cargo_meta ["packages" ][0 ]
30
+
31
+ features = ["" ] + ["{} rt" .format (x )
32
+ for x in crate_info ["features" ].keys ()
33
+ if x != "device-selected" and x != "rt" ]
34
+
35
+ if 'size_check' in sys .argv :
36
+ cargo_cmd = ['cargo' , 'build' , '--release' ]
37
+ else :
38
+ cargo_cmd = ['cargo' , 'check' ]
39
+
40
+ if not all (map (lambda f : run (f , cargo_cmd ),
41
+ features )):
42
+ sys .exit (- 1 )
43
+
44
+
45
+ if __name__ == "__main__" :
46
+ main ()
47
+
You can’t perform that action at this time.
0 commit comments