Commit ffb3198 1 parent 0de3e63 commit ffb3198 Copy full SHA for ffb3198
File tree 3 files changed +50
-0
lines changed
3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Rust CI
2
+
3
+ on :
4
+ push :
5
+ branches : [ main ]
6
+ pull_request :
7
+ branches : [ main ]
8
+
9
+ jobs :
10
+ build :
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - name : Checkout code
15
+ uses : actions/checkout@v2
16
+
17
+ - name : Set up Rust
18
+ uses : actions/setup-rust@v1
19
+ with :
20
+ rust-version : 1.56
21
+
22
+ - name : Run Tests
23
+ run : cargo test
24
+
25
+ - name : Run Clippy
26
+ run : cargo clippy -- -D warnings
27
+
28
+ - name : Run Rustfmt
29
+ run : cargo fmt -- --check
30
+
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " crown"
3
+ version = " 0.1.0"
4
+ edition = " 2021"
5
+
6
+ [dependencies ]
Original file line number Diff line number Diff line change
1
+ fn add ( a : i32 , b : i32 ) -> i32 {
2
+ a + b
3
+ }
4
+
5
+ #[ cfg( test) ]
6
+ mod tests {
7
+ use super :: * ;
8
+
9
+ #[ test]
10
+ fn test_add ( ) {
11
+ assert_eq ! ( add( 2 , 3 ) , 5 ) ;
12
+ }
13
+ }
14
+
You can’t perform that action at this time.
0 commit comments