Small fixes #872
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: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the Repository | |
uses: actions/checkout@v2 | |
- name: Install CUDA | |
run: | | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin | |
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 | |
curl -L -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.0-1_all.deb | |
sudo dpkg -i cuda-keyring_1.0-1_all.deb | |
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" | |
sudo apt-get update -q | |
sudo apt-get install cuda -y --no-install-recommends | |
- name: Install OpenMPI | |
run: | | |
sudo apt-get update -q | |
sudo apt-get install libopenmpi-dev -y --no-install-recommends | |
- name: Install the Rust toolchain | |
run: | | |
cargo install grcov --force --locked | |
rustup component add llvm-tools-preview | |
- name: Install the rust-ptx-linker | |
run: | | |
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh | |
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+") | |
rm llvm.sh | |
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force | |
- name: Generate the code coverage | |
run: | | |
RUSTFLAGS="-Cinstrument-coverage" \ | |
LLVM_PROFILE_FILE="codecov-%p-%m.profraw" \ | |
cargo test --workspace | |
grcov . -s . --binary-path ./target/debug/ \ | |
-t cobertura -o cobertura.xml --branch \ | |
--keep-only "necsim/*" \ | |
--keep-only "rustcoalescence/*" \ | |
--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 }} | |
fail_ci_if_error: true |