Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include coverage instrumentation #797

Closed
wants to merge 14 commits into from
30 changes: 29 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
matrix:
rust: [stable, 1.71.0]
test: ['std', 'no-std']
include:
- rust: stable
test: std
rustflags: -Cinstrument-coverage
rustcomponents: ', llvm-tools-preview'
steps:
- name: free disk space
run: |
Expand All @@ -33,7 +38,7 @@ jobs:
- name: install rust
uses: dtolnay/rust-toolchain@master
with:
components: rustfmt, clippy
components: rustfmt, clippy ${{ matrix.rustcomponents }}
toolchain: ${{ matrix.rust }}

- name: caching
Expand All @@ -51,6 +56,29 @@ jobs:

- name: run checks & tests
run: RUST_MATRIX=${{ matrix.rust }} cargo xtask run-checks ${{ matrix.test }}
env:
RUSTFLAGS: ${{ matrix.rustflags }}
CARGO_INCREMENTAL: 0
LLVM_PROFILE_FILE: coverage-%p-%s.profraw

- name: Install grcov
if: matrix.rust == 'stable' && matrix.test == 'std'
env:
GRCOV_LINK: https://github.com/mozilla/grcov/releases/download
GRCOV_VERSION: v0.8.18
run: |
curl -L "$GRCOV_LINK/$GRCOV_VERSION/grcov-x86_64-unknown-linux-musl.tar.bz2" |
tar xj -C $HOME/.cargo/bin

- name: Run grcov
if: matrix.rust == 'stable' && matrix.test == 'std'
run: grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore 'target/**' --ignore '../**' --ignore '/*' -o lcov.info

- name: Codecov upload
if: matrix.rust == 'stable' && matrix.test == 'std'
uses: codecov/codecov-action@v3
with:
files: lcov.info

check-typos:
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
[![Current Crates.io Version](https://img.shields.io/crates/v/burn.svg)](https://crates.io/crates/burn)
[![Rust Version](https://img.shields.io/badge/Rust-1.71.0+-blue)](https://releases.rs/docs/1.71.0)
![license](https://shields.io/badge/license-MIT%2FApache--2.0-blue)
[![CodeCov][codecov badge]][codecov]

<!-- Links -->
[codecov]: https://codecov.io/gh/burn-rs/burn/

<!-- Badges -->
[codecov badge]: https://codecov.io/gh/burn-rs/burn/branch/main/graph/badge.svg

This library strives to serve as a comprehensive **deep learning framework**, offering exceptional
flexibility and written in Rust. Our objective is to cater to both researchers and practitioners by
Expand Down