Skip to content

Commit

Permalink
fix: replace cargo-tarpaulin with cargo-llvm-cov, use system librocks…
Browse files Browse the repository at this point in the history
…db (#19)

* chore: replace cargo-tarpaulin with cargo-llvm-cov

* chore: use system librocksdb
  • Loading branch information
tedil authored Jan 3, 2025
1 parent e107be6 commit 2ed4016
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[env]
ROCKSDB_LIB_DIR = "/usr/lib/"
SNAPPY_LIB_DIR = "/usr/lib/"
45 changes: 23 additions & 22 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ on:

jobs:
Formatting:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -27,10 +27,15 @@ jobs:
cargo fmt -- --check
Linting:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y librocksdb-dev libsnappy-dev libsqlite3-dev
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -46,13 +51,18 @@ jobs:

Testing:
needs: Formatting
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
lfs: true

- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y librocksdb-dev libsnappy-dev libsqlite3-dev
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -61,21 +71,12 @@ jobs:

- uses: Swatinem/rust-cache@v2

- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]
with:
version: 0.21.0
args: "--all-features -- --test-threads 1"

- name: Build all examples
uses: actions-rs/cargo@v1
with:
command: build
args: --examples

- name: Codecov
uses: codecov/codecov-action@v3
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
verbose: true
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
8 changes: 4 additions & 4 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ use thiserror::Error;
/// Error type for `rocksdb-utils-lookup`
#[derive(Error, Debug)]
pub enum Error {
/// Problem opening RocksDB.
/// Problem opening `RocksDB`.
#[error("problem opening RocksDB at {0}: {1}")]
Open(std::path::PathBuf, #[source] rocksdb::Error),
/// Problem with RocksDB property query.
/// Problem with `RocksDB` property query.
#[error("problem accessing RocksDB property: {0}")]
PropertyAccess(#[source] rocksdb::Error),
/// The RocksDB property was not set.
/// The `RocksDB` property was not set.
#[error("RocksDB property {0} was not set")]
PropertyNotSet(String),
/// Problem with acessing RocksDB column family.
/// Problem with acessing `RocksDB` column family.
#[error("problem accessing RocksDB column family: {0}")]
ColumnFamily(String),
/// Problem with loading data.
Expand Down

0 comments on commit 2ed4016

Please sign in to comment.