File tree Expand file tree Collapse file tree 7 files changed +79
-0
lines changed Expand file tree Collapse file tree 7 files changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Continuous Integration Checks
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+ build :
7
+ strategy :
8
+ matrix :
9
+ toolchain : [ stable, beta ]
10
+ include :
11
+ - toolchain : stable
12
+ check-fmt : true
13
+ runs-on : ubuntu-latest
14
+ steps :
15
+ - name : Checkout source code
16
+ uses : actions/checkout@v2
17
+ - name : Install Protobuf compiler (protoc)
18
+ uses : arduino/setup-protoc@v1
19
+ - name : Install Rust ${{ matrix.toolchain }} toolchain
20
+ uses : actions-rs/toolchain@v1
21
+ with :
22
+ toolchain : ${{ matrix.toolchain }}
23
+ override : true
24
+ profile : minimal
25
+ - name : Build on Rust ${{ matrix.toolchain }}
26
+ run : cargo build --verbose --color always
27
+ - name : Check formatting
28
+ if : matrix.check-fmt
29
+ run : rustup component add rustfmt && cargo fmt --all -- --check
30
+ - name : Test on Rust ${{ matrix.toolchain }}
31
+ run : cargo test
Original file line number Diff line number Diff line change
1
+ /target
2
+ /vss-accessor /src /proto /
Original file line number Diff line number Diff line change
1
+ [workspace ]
2
+ members = [
3
+ " vss-accessor" ,
4
+ ]
Original file line number Diff line number Diff line change
1
+ hard_tabs = true # use tab characters for indentation, spaces for alignment
2
+ use_field_init_shorthand = true
3
+ max_width = 120
4
+ use_small_heuristics = " Max"
5
+ chain_width = 80
6
+ fn_args_layout = " Compressed"
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " vss-accessor"
3
+ version = " 0.1.0"
4
+ edition = " 2021"
5
+ build = " build.rs"
6
+
7
+ [dependencies ]
8
+
9
+ [dev-dependencies ]
10
+
11
+ [build-dependencies ]
12
+ prost-build = { version = " 0.11.3" }
13
+ reqwest = { version = " 0.11.13" , features = [" blocking" ] }
Original file line number Diff line number Diff line change
1
+ extern crate prost_build;
2
+
3
+ use std:: fs;
4
+ use std:: fs:: File ;
5
+ use std:: path:: Path ;
6
+
7
+ fn main ( ) {
8
+ download_file (
9
+ "https://raw.githubusercontent.com/lightningdevkit/vss-server/main/app/src/main/proto/vss.proto" ,
10
+ "src/proto/vss.proto" ,
11
+ )
12
+ . unwrap ( ) ;
13
+
14
+ prost_build:: compile_protos ( & [ "src/proto/vss.proto" ] , & [ "src/" ] ) . unwrap ( ) ;
15
+ }
16
+
17
+ fn download_file ( url : & str , save_to : & str ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
18
+ let mut response = reqwest:: blocking:: get ( url) ?;
19
+ fs:: create_dir_all ( Path :: new ( save_to) . parent ( ) . unwrap ( ) ) ?;
20
+ let mut out_file = File :: create ( save_to) ?;
21
+ response. copy_to ( & mut out_file) ?;
22
+ Ok ( ( ) )
23
+ }
You can’t perform that action at this time.
0 commit comments