Skip to content

Commit 67caed8

Browse files
authored
Add CI (#4)
* Add CI * remove unneccesary as u16
1 parent b54945f commit 67caed8

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Rust CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
check-and-test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install Rust
19+
uses: dtolnay/rust-toolchain@stable
20+
21+
- name: Cache Cargo registry + build
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
~/.cargo/registry
26+
~/.cargo/git
27+
target
28+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
29+
30+
- name: Rustfmt check
31+
run: cargo fmt --all -- --check
32+
33+
- name: Clippy lint
34+
run: cargo clippy --all-targets --all-features -- -D warnings
35+
36+
- name: Build release
37+
run: cargo build --release
38+
39+
- name: Run tests
40+
run: cargo test --all-targets

src/free_stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ mod tests {
131131

132132
let stack = unsafe { buffer.as_mut_ptr().cast::<FreeStack>().as_mut() }.unwrap();
133133
unsafe {
134-
stack.reset(max_capacity as u16);
134+
stack.reset(max_capacity);
135135
}
136136
assert!(stack.is_full());
137137

0 commit comments

Comments
 (0)