Skip to content

Commit

Permalink
Merge pull request #13 from nyris/feature/codecov
Browse files Browse the repository at this point in the history
Add codecov support
  • Loading branch information
sunsided authored May 14, 2024
2 parents 82824bb + d0758dc commit 3a36393
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 17 deletions.
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/[email protected]
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

0 comments on commit 3a36393

Please sign in to comment.