Skip to content
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
35 changes: 35 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.

# Codecov configuration for DiskANN Rust code coverage
# See: https://docs.codecov.com/docs/codecov-yaml

coverage:
status:
# Project coverage (overall) - informational only
project:
default:
target: auto
threshold: 1%
informational: true

# Patch coverage (changed lines only) - this will block PRs
patch:
default:
target: 90%
threshold: 0%
informational: false

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: false
require_base: false
require_head: true

ignore:
- "test_data/**"
- "**/*_test.rs"
- "**/tests/**"
- "**/benches/**"
- "**/examples/**"
78 changes: 37 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,51 +158,47 @@ jobs:

cargo test --doc --workspace --profile ci

# coverage:
# needs: basics
# name: code coverage
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# lfs: true
coverage:
needs: basics
name: code coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0

# - name: Install Rust ${{ env.rust_stable }}
# uses: dtolnay/rust-toolchain@stable
# with:
# toolchain: ${{ env.rust_stable }}
# components: llvm-tools-preview
- name: Install Rust ${{ env.rust_stable }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust_stable }}
components: llvm-tools-preview

# - name: Install cargo-llvm-cov
# uses: taiki-e/install-action@v2
# with:
# tool: cargo-llvm-cov
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov

# - name: Install cargo-nextest
# uses: taiki-e/install-action@v2
# with:
# tool: cargo-nextest
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest

# - uses: Swatinem/rust-cache@v2
# - name: Generate code coverage
# run: |
# cargo llvm-cov nextest --cargo-profile ci \
# --package diskann-wide \
# --package diskann-vector \
# --package diskann-quantization \
# --package diskann \
# --package diskann-linalg \
# --package diskann-utils \
# --package diskann-disk \
# --lcov --output-path lcov.info

# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v4
# with:
# files: lcov.info
# fail_ci_if_error: false
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- uses: Swatinem/rust-cache@v2

- name: Generate code coverage
run: |
cargo llvm-cov nextest --cargo-profile ci \
--workspace \
--lcov --output-path lcov.info

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: lcov.info
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# miri:
# needs: basics
Expand Down
Loading