Skip to content

Commit eba8a23

Browse files
committed
add stub unit test, actions to test+measure coverage
1 parent fa532a9 commit eba8a23

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/test.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,30 @@ jobs:
3737

3838
- name: cargo machete
3939
run: cargo machete
40+
41+
test:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: checkout
45+
uses: actions/checkout@v4
46+
47+
- name: cache rust deps
48+
uses: Swatinem/rust-cache@v2
49+
50+
- name: install cargo-llvm-cov
51+
uses: taiki-e/install-action@cargo-llvm-cov
52+
53+
- name: fetch deps
54+
run: cargo fetch
55+
56+
- name: build tests
57+
run: cargo test --no-run
58+
59+
- name: run tests
60+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
61+
62+
- name: upload to codecov
63+
uses: codecov/codecov-action@v5
64+
with:
65+
token: ${{ secrets.CODECOV_TOKEN }}
66+
files: lcov.info

tests/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#[test]
2+
fn test_hello_world() {
3+
assert_eq!(1, 1)
4+
}

0 commit comments

Comments
 (0)