File tree 3 files changed +32
-10
lines changed
3 files changed +32
-10
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ on: [pull_request]
3
3
name : Continuous Integration
4
4
5
5
jobs :
6
- test :
6
+ Test :
7
7
name : Test Suite
8
8
runs-on : ubuntu-latest
9
9
strategy :
@@ -13,20 +13,17 @@ jobs:
13
13
- stable
14
14
- nightly
15
15
steps :
16
+ - name : Checkout Crate
16
17
- uses : actions/checkout@v2
18
+ - name : Checkout Toolchain
17
19
- uses : actions-rs/toolchain@v1
18
20
with :
19
21
profile : minimal
20
22
toolchain : ${{ matrix.rust }}
21
23
override : true
22
- - uses : actions-rs/cargo@v1
23
- with :
24
- command : test
25
- args : --verbose --no-default-features --features strict alloc
26
- - uses : actions-rs/cargo@v1
27
- with :
28
- command : test
29
- args : --verbose --no-default-features --features strict std
24
+ - name : Run Test Script
25
+ env : ${{ matrix.rust }}
26
+ run : ./contrib/test.sh
30
27
31
28
fmt :
32
29
name : Rustfmt
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ #
3
+ # CI test script for rust-bech32.
4
+ #
5
+ # The "strict" feature is used to configure cargo to deny all warnings, always use it in test runs.
6
+
7
+ set -ex
8
+
9
+ # Sanity, check tools exist.
10
+ cargo --version
11
+ rustc --version
12
+
13
+ # Check without features ("strict" is a CI feature only, see above).
14
+ cargo build --no-default-features --features=" strict"
15
+ cargo test --no-default-features --features=" strict"
16
+
17
+ # Check "std" feature (implies "alloc").
18
+ cargo build --no-default-features --features=" strict std"
19
+ cargo test --no-default-features --features=" strict std"
20
+
21
+ # Check "alloc" feature alone.
22
+ cargo build --no-default-features --features=" strict alloc"
23
+ cargo test --no-default-features --features=" strict alloc"
24
+
25
+ exit 0
Original file line number Diff line number Diff line change @@ -67,9 +67,9 @@ extern crate core;
67
67
use alloc:: borrow:: Cow ;
68
68
#[ cfg( all( feature = "alloc" , not( feature = "std" ) ) ) ]
69
69
use alloc:: { string:: String , vec:: Vec } ;
70
- use core:: convert:: TryFrom ;
71
70
#[ cfg( feature = "alloc" ) ]
72
71
use core:: convert:: Infallible ;
72
+ use core:: convert:: TryFrom ;
73
73
use core:: { fmt, mem} ;
74
74
#[ cfg( feature = "std" ) ]
75
75
use std:: borrow:: Cow ;
You can’t perform that action at this time.
0 commit comments