Skip to content

Commit cbb77da

Browse files
authored
Merge pull request #3 from sunsided/feature/codecov
Add code coverage
2 parents 1638b68 + 27dd4d2 commit cbb77da

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/workflows/rust.yml

+16-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,20 @@ jobs:
8181
sudo apt-get update
8282
sudo apt-get install -y libclang-dev libopencv-dev ocl-icd-opencl-dev intel-opencl-icd
8383
84-
- run: env
84+
- name: Build libraries and sample
85+
run: cargo build
86+
87+
- name: Run Docests
88+
run: cargo test --doc
89+
90+
- name: Install cargo-llvm-cov
91+
uses: taiki-e/install-action@cargo-llvm-cov
92+
- name: Generate code coverage
93+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
94+
- name: Upload coverage to Codecov
95+
uses: codecov/codecov-action@v4.0.1
96+
with:
97+
token: ${{ secrets.CODECOV_TOKEN }}
98+
files: lcov.info
99+
fail_ci_if_error: true
85100

86-
- name: Run Tests
87-
run: cargo test

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
**/*.rs.bk
1717

1818
.idea/
19+
/lcov.info
1920

2021
# End of https://www.toptal.com/developers/gitignore/api/rust,clion

0 commit comments

Comments
 (0)