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

Add codecov support #13

Merged
merged 5 commits into from
May 14, 2024
Merged
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
45 changes: 37 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Rust

on:
Expand All @@ -11,14 +12,42 @@ env:

jobs:
build:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- name: Check format
run: cargo fmt --check
- name: Build
run: cargo build --verbose
- uses: taiki-e/install-action@nextest
- name: Run tests
run: cargo nextest run --verbose --all-features
- name: Run doctests
run: cargo test --doc --verbose --all-features

codecov:
name: Code Coverage
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose --features=serde
- name: Run doctests
run: cargo test --doc --verbose --features=serde
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Generate code coverage
run: cargo llvm-cov nextest --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
/Cargo.lock
/.idea
/lcov.info
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ rust-version = "1.67.1"

[features]
default = ["fast-rng"]
arbitrary = ["uuid/arbitrary", "arbitrary/derive"] # Add support for arbitrary types
random = ["uuid/v4"] # Create random ShortGuid IDs
fast-rng = ["random", "uuid/fast-rng"] # Use a faster (but still sufficiently random) RNG
serde = ["dep:serde", "uuid/serde"] # Serialization and deserialization support
# zerocopy = ["dep:zerocopy", "uuid/zerocopy"] # Zerocopy support
bytemuck = ["dep:bytemuck", "uuid/bytemuck"] # Bytemuck support
arbitrary = ["uuid/arbitrary", "arbitrary/derive"] # Add support for arbitrary types
random = ["uuid/v4"] # Create random ShortGuid IDs
fast-rng = ["random", "uuid/fast-rng"] # Use a faster (but still sufficiently random) RNG
serde = ["dep:serde", "uuid/serde"] # Serialization and deserialization support
# zerocopy = ["dep:zerocopy", "uuid/zerocopy"] # Zerocopy support
bytemuck = ["dep:bytemuck", "uuid/bytemuck"] # Bytemuck support
borsh = ["dep:borsh", "dep:borsh-derive", "uuid/borsh"] # Borsh support

[[example]]
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# ShortGuid

Short URL-safe Base64 encoded UUIDs.
[![codecov](https://codecov.io/gh/nyris/shortguid-rs/graph/badge.svg?token=YOM7OCX28D)](https://codecov.io/gh/nyris/shortguid-rs)

Short URL-safe Base64 encoded UUIDs.

---

ShortGuids transparently represent UUID types but use only 22 characters
ShortGuids transparently represent UUID types but use only 22 characters
in their string representation, as opposed to 36 characters for a dashed
UUID or 32 without dashes.

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! # shortguid
//!
//!
//! Provides short, URL-safe UUID representations.
//!
//! ```
Expand Down