Skip to content

Commit

Permalink
Rework (#20)
Browse files Browse the repository at this point in the history
* Properly feature gate the tests

* Rework fmt a bit

* Rework CI
  • Loading branch information
fbernier authored Jan 9, 2025
1 parent 49d91c1 commit acb6e1e
Show file tree
Hide file tree
Showing 3 changed files with 419 additions and 597 deletions.
49 changes: 36 additions & 13 deletions .github/workflows/base62.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ jobs:
uses: dtolnay/rust-toolchain@stable
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Run cargo check
run: cargo check --all-targets --all-features
- name: Run cargo check (no_std)
run: cargo check --all-targets --no-default-features
- name: Run cargo check (default/alloc)
run: cargo check --all-targets
- name: Run cargo check (std)
run: cargo check --all-targets --features std

test:
name: Test Suite
Expand All @@ -34,16 +38,23 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --all-targets --all-features
- name: Run doc tests
run: cargo test --doc --all-features
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@nextest
- name: Run tests (no_std)
run: cargo nextest run --no-default-features
- name: Run tests (default/alloc)
run: cargo nextest run
- name: Run tests (std)
run: cargo nextest run --features std
- name: Run doc tests (no_std)
run: cargo test --doc --no-default-features
- name: Run doc tests (default/alloc)
run: cargo test --doc
- name: Run doc tests (std)
run: cargo test --doc --features std

fmt:
name: Rustfmt
Expand All @@ -68,8 +79,12 @@ jobs:
components: clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Run clippy
run: cargo clippy --all-targets --all-features
- name: Run clippy (no_std)
run: cargo clippy --all-targets --no-default-features
- name: Run clippy (default/alloc)
run: cargo clippy --all-targets
- name: Run clippy (std)
run: cargo clippy --all-targets --features std

docs:
name: Docs
Expand All @@ -80,7 +95,15 @@ jobs:
uses: dtolnay/rust-toolchain@stable
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Check documentation
- name: Check documentation (no_std)
env:
RUSTDOCFLAGS: "-D warnings"
run: cargo doc --no-deps --document-private-items --no-default-features
- name: Check documentation (default/alloc)
env:
RUSTDOCFLAGS: "-D warnings"
run: cargo doc --no-deps --document-private-items
- name: Check documentation (std)
env:
RUSTDOCFLAGS: "-D warnings"
run: cargo doc --no-deps --document-private-items --features std
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[package]
name = "base62"
version = "2.1.0"
version = "2.1.1"
authors = [
"François Bernier <[email protected]>",
"Chai T. Rex <[email protected]>",
"Kevin Darlington <[email protected]>",
"Christopher Tarquini <[email protected]>",
]
edition = "2018"
description = "A Base62 encoding/decoding library"
Expand Down Expand Up @@ -35,3 +33,4 @@ rand = "0.8"
[[bench]]
name = "base62"
harness = false
required-features = ["alloc"]
Loading

0 comments on commit acb6e1e

Please sign in to comment.