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

Use cargo llvm-cov for coverage reports #2993

Draft
wants to merge 3 commits into
base: latest
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 10 additions & 20 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,31 +85,21 @@ jobs:

coverage:
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Install cargo-binstall
run: |
wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-gnu.tgz
tar xf cargo-binstall-x86_64-unknown-linux-gnu.tgz
chmod +x cargo-binstall
mv cargo-binstall "$HOME/.cargo/bin"

- name: Install cargo-tarpaulin
run: cargo binstall --no-confirm cargo-tarpaulin

- name: Coverage with tarpaulin
run: cargo tarpaulin --all --all-features --timeout 600 --out xml -- --test-threads 1

- name: Upload Rust coverage to codecov
- name: Install Rust
run: rustup update stable
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
flags: rust
files: codecov.json
fail_ci_if_error: true

lints:
Expand Down
14 changes: 8 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
inherit system overlays;
};
rustVersion = pkgs.rust-bin.stable.latest.default.override {
#extensions = [ "rust-src" ];
extensions = [ "rust-src" "llvm-tools-preview" ];
#targets = [ "x86_64-unknown-linux-musl" ];
targets = [ "wasm32-wasi" "wasm32-unknown-unknown" "wasm32-unknown-emscripten" ];
};
Expand Down Expand Up @@ -59,14 +59,14 @@
{
packages = {

lib = rustPlatform.buildRustPackage ( commonArgs // {
lib = rustPlatform.buildRustPackage (commonArgs // {
name = "libsourmash";
copyLibs = true;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = with rustPlatform; [ bindgenHook ];
});

sourmash = python.buildPythonPackage ( commonArgs // rec {
sourmash = python.buildPythonPackage (commonArgs // rec {
pname = "sourmash";
version = "4.8.6";
format = "pyproject";
Expand Down Expand Up @@ -128,13 +128,15 @@
cargo-outdated
cargo-udeps
cargo-deny
#cargo-semver-checks
nixpkgs-fmt
] ++ lib.optionals (!stdenv.isDarwin) [
cargo-semver-checks
cargo-llvm-cov
];

shellHook = ''
export MACOSX_DEPLOYMENT_TARGET=10.14
'';
export MACOSX_DEPLOYMENT_TARGET=10.14
'';

# Needed for matplotlib
LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.stdenv.cc.cc.lib ];
Expand Down
Loading