Skip to content

Commit ffb3198

Browse files
committed
solved issuse #1
1 parent 0de3e63 commit ffb3198

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

.github/workflows/ci.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+

crown/Cargo.toml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "crown"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]

crown/src/main.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+

0 commit comments

Comments
 (0)