Skip to content
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
148 changes: 45 additions & 103 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,166 +2,108 @@ name: CI

on:
push:
branches:
- main
- develop
tags-ignore:
- v*
branches: [main, develop]
tags-ignore: [v*]
pull_request:
branches:
- develop
branches: [develop]

jobs:
lints:
lint:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v6

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt, clippy

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
rustflags: ""

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

- name: Run cargo check
run: cargo check --all-targets --all-features

- name: Run cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
name: Clippy Output
run: cargo clippy --all-targets --all-features -- -D warnings

build:
name: Build
needs: [lints]
needs: [lint]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v6

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
rustflags: ""

- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features
run: cargo build --all-features

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
run: cargo test --all-features

build-target:
name: Build on ${{ matrix.os }} for ${{ matrix.target }} target
needs: [lints]
name: Build on ${{ matrix.name }}
needs: [lint]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
target: ['']
include:
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-latest
target: x86_64-apple-ios
- os: macos-latest
target: aarch64-apple-ios
- os: windows-latest
target: x86_64-pc-windows-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: i686-pc-windows-gnu
- os: windows-latest
target: i686-pc-windows-msvc
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: ubuntu-latest
target: i686-unknown-linux-gnu
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-linux-android
- os: ubuntu-latest
target: armv7-linux-androideabi
name: Windows
- os: macos-latest
name: MacOS
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v6

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
profile: minimal
toolchain: nightly
target: ${{ matrix.target }}
override: true
rustflags: ""

- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features
run: cargo build --all-features

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
run: cargo test --all-features

coverage:
name: Code coverage
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v6

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
rustflags: ""

- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
version: 0.22.0
args: --all-features
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov

- name: Generate coverage report (Cobertura)
run: cargo llvm-cov --workspace --all-features --cobertura --output-path cobertura.xml

- name: Upload to codecov.io
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
files: ./cobertura.xml
token: ${{ secrets.CODECOV_TOKEN }}
files: cobertura.xml
fail_ci_if_error: true

- name: Archive code coverage results
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
name: coverage-report
path: cobertura.xml
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.5] - 2026-02-11
### Changed
- Remove the const generic parameter, making the crate fully compatible with **stable Rust**
(no more nightly toolchain required).
- Introduce a sealed `Case` trait to control casing behavior at the type level.

### Added
- Add `Uppercase` and `Lowercase` tag types implementing `Case`.

## [0.1.3] - 2022-04-28
### Changed
- Bump Rust edition to 2021
Expand All @@ -28,7 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Convenient type aliases `UpperHexString` and `LowerHexString`.
- Feature flag `serde` for serde support on `HexString` type.

[Unreleased]: https://github.com/alekece/hextring-rs/compare/v0.1.3...HEAD
[Unreleased]: https://github.com/alekece/hextring-rs/compare/v0.1.5...HEAD
[0.1.5]: https://github.com/alekece/hexstring-rs/releases/tag/v0.1.5
[0.1.3]: https://github.com/alekece/hexstring-rs/releases/tag/v0.1.3
[0.1.2]: https://github.com/alekece/hexstring-rs/releases/tag/v0.1.2
[0.1.1]: https://github.com/alekece/hexstring-rs/releases/tag/v0.1.1
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hexstring"
version = "0.1.4"
version = "0.1.5"
edition = "2021"
license = "MIT"
keywords = ["hex", "hexadecimal", "string", "utility"]
Expand All @@ -14,12 +14,12 @@ rust-version = "1.58.0"
maintenance = { status = "actively-developed" }

[dependencies]
serde = { version = "1.0.126", default-features = false, features = ["std", "derive"], optional = true}
derive_more = { version = "0.99.16", default-features = false, features = ["display"] }
serde = { version = "1.0.228", default-features = false, features = ["std", "derive"], optional = true}
derive_more = { version = "2.1.1", default-features = false, features = ["display"] }
hex = "0.4.3"

[dev-dependencies]
serde_json = "1.0.64"
serde_json = "1.0.149"

[features]
default = ["serde"]
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ It allows all the common conversion expected from a hexadecimal string :
- Construct from both string and string literal
- Convert from and into array of bytes

The [`HexString`](https://docs.rs/hexstring/latest/hexstring/struct.HexString.html) type is a tiny immutable wrapper around string and insure it always contains a
valid hexadecimal string.
The [`HexString`](https://docs.rs/hexstring/latest/hexstring/struct.HexString.html) type is a tiny
immutable wrapper around string and insure it always contains a valid hexadecimal string.

## Feature flags

Expand All @@ -27,14 +27,6 @@ The following are a list of [Cargo features][cargo-features] that can be enabled

<!-- cargo-sync-readme end -->

## Requirements
`hexstring` crate uses unstable constant generic type internally.
To compile the library in any project, build it in nightly mode such as :

``` sh
rustup override set nightly
```

## License

Licensed under MIT license ([LICENSE](LICENSE) or http://opensource.org/licenses/MIT)
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly"
channel = "stable"
Loading