Merge branch 'main' into cust #381
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Coverage | |
on: [push] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install CUDA | |
uses: Jimver/[email protected] | |
with: | |
method: network | |
use-github-cache: false | |
use-local-cache: false | |
- name: Checkout the Repository | |
uses: actions/checkout@v2 | |
- name: Install the Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
profile: minimal | |
components: llvm-tools-preview | |
target: nvptx64-nvidia-cuda | |
override: false # FIXME | |
- name: Generate the coverage data | |
run: | | |
cargo clean | |
cargo \ | |
--config "target.'cfg(all())'.rustflags=['-Cinstrument-coverage']" \ | |
test --workspace --all-targets | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTDOCFLAGS: -Cinstrument-coverage | |
LLVM_PROFILE_FILE: coverage/coverage-%p-%m.profraw | |
- name: Download grcov | |
run: | | |
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.18/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - | |
chmod +x ./grcov | |
- name: Generate the coverage reports | |
run: | | |
./grcov . -s . --binary-path ./target/debug/deps \ | |
-t lcov -o coverage.lcov --branch \ | |
--keep-only "src/*" \ | |
--keep-only "rust-cuda-derive/*" \ | |
--keep-only "rust-cuda-kernel/*" \ | |
--ignore-not-existing \ | |
--excl-line GRCOV_EXCL_LINE \ | |
--excl-start GRCOV_EXCL_START \ | |
--excl-stop GRCOV_EXCL_STOP | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.lcov | |
fail_ci_if_error: true |