-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
260 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
merge_group: | ||
types: [checks_requested] | ||
push: | ||
branches: [master] | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
read_msrv: | ||
name: Read MSRV | ||
uses: actions-rust-lang/msrv/.github/workflows/[email protected] | ||
|
||
rust: | ||
needs: read_msrv | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- { name: Linux, runner: ubuntu-latest } | ||
- { name: macOS, runner: macos-latest } | ||
- { name: Windows, runner: windows-latest } | ||
toolchain: | ||
- { name: stable, version: stable } | ||
- { name: msrv, version: "${{ needs.read_msrv.outputs.msrv }}" } | ||
|
||
name: ${{ matrix.os.name }} / ${{ matrix.toolchain.name }} | ||
runs-on: ${{ matrix.os.runner }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Rust (${{ matrix.toolchain.name }}) | ||
uses: actions-rust-lang/[email protected] | ||
with: | ||
toolchain: ${{ matrix.toolchain.version }} | ||
|
||
- name: Install just, nextest | ||
uses: taiki-e/[email protected] | ||
with: | ||
tool: just,nextest | ||
|
||
- name: Test | ||
run: just test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Coverage | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: actions-rust-lang/[email protected] | ||
with: | ||
components: llvm-tools-preview | ||
|
||
- name: Install just & cargo-llvm-cov | ||
uses: taiki-e/[email protected] | ||
with: | ||
tool: just,cargo-llvm-cov | ||
|
||
- name: Generate code coverage | ||
run: just test-coverage-codecov | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
files: codecov.json | ||
fail_ci_if_error: true | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Lint | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
clippy: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
checks: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: actions-rust-lang/[email protected] | ||
with: | ||
components: clippy | ||
|
||
- name: Install just, cargo-hack | ||
uses: taiki-e/[email protected] | ||
with: | ||
tool: just,cargo-hack | ||
|
||
- name: Check with Clippy | ||
run: just clippy | ||
|
||
rustfmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Rust (nightly) | ||
uses: actions-rust-lang/[email protected] | ||
with: | ||
toolchain: nightly | ||
components: rustfmt | ||
|
||
- name: Check with Rustfmt | ||
run: cargo fmt -- --check | ||
|
||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Rust (nightly) | ||
uses: actions-rust-lang/[email protected] | ||
with: | ||
toolchain: nightly | ||
components: rust-docs | ||
|
||
- name: Check for broken intra-doc links | ||
env: | ||
RUSTDOCFLAGS: -D warnings | ||
run: cargo doc --workspace --no-deps --all-features | ||
|
||
sorted-deps: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: actions-rust-lang/[email protected] | ||
with: | ||
components: clippy | ||
|
||
- name: Install just, cargo-sort | ||
uses: taiki-e/[email protected] | ||
with: | ||
tool: just,cargo-sort | ||
|
||
- name: Check dependency requirements are sorted lexicographically | ||
run: cargo sort --workspace --check |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
[package] | ||
name = "bytesize" | ||
description = "A utility for human-readable bytes representations. Forked from https://github.com/hyunsik/bytesize ." | ||
description = "A utility for human-readable byte count representations" | ||
version = "1.4.0-dev" | ||
authors = ["Hyunsik Choi <[email protected]>", "MrCroxx <[email protected]>"] | ||
edition = "2021" | ||
|
||
homepage = "https://github.com/hyunsik/bytesize/" | ||
documentation = "https://docs.rs/bytesize/" | ||
repository = "https://github.com/hyunsik/bytesize/" | ||
readme = "README.md" | ||
keywords = ["byte", "byte-size", "utility", "human-readable", "format"] | ||
categories = ["development-tools", "filesystem"] | ||
repository = "https://github.com/hyunsik/bytesize" | ||
license = "Apache-2.0" | ||
edition = "2021" | ||
rust-version = "1.65" | ||
|
||
[dependencies] | ||
arbitrary = { version = "1", features = ["derive"], optional = true } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
_list: | ||
@just --list | ||
|
||
msrv := ``` | ||
cargo metadata --format-version=1 \ | ||
| jq -r 'first(.packages[] | select(.source == null and .rust_version)) | .rust_version' \ | ||
| sed -E 's/^1\.([0-9]{2})$/1\.\1\.0/' | ||
``` | ||
msrv_rustup := "+" + msrv | ||
|
||
# Check project. | ||
[group("lint")] | ||
check: && clippy | ||
just --unstable --fmt --check | ||
# fd --hidden -e=toml --exec-batch taplo format --check | ||
# fd --hidden -e=toml --exec-batch taplo lint | ||
# fd --hidden --type=file -e=md -e=yml --exec-batch prettier --check | ||
cargo +nightly fmt -- --check | ||
|
||
# Format project. | ||
[group("lint")] | ||
fmt: | ||
just --unstable --fmt | ||
# fd --hidden -e=toml --exec-batch taplo format | ||
# fd --hidden --type=file -e=md -e=yml --exec-batch prettier --write | ||
cargo +nightly fmt | ||
|
||
# Lint workspace with Clippy. | ||
[group("lint")] | ||
clippy: | ||
cargo clippy --workspace --all-targets --no-default-features | ||
cargo clippy --workspace --all-targets --all-features | ||
|
||
# Test workspace. | ||
[group("test")] | ||
test toolchain="": | ||
cargo {{ toolchain }} nextest run --workspace --no-default-features | ||
cargo {{ toolchain }} nextest run --workspace --all-features | ||
cargo {{ toolchain }} test --doc --workspace --all-features | ||
RUSTDOCFLAGS="-D warnings" cargo {{ toolchain }} doc --workspace --no-deps --all-features | ||
|
||
# Downgrade dev-dependencies necessary to run MSRV checks/tests. | ||
[private] | ||
downgrade-msrv: | ||
# "No MSRV downgrades currently necessary" | ||
|
||
# Test workspace using MSRV. | ||
[group("test")] | ||
test-msrv: downgrade-msrv (test msrv_rustup) | ||
|
||
# Test workspace and generate Codecov coverage file | ||
[group("test")] | ||
test-coverage-codecov toolchain="": | ||
cargo {{ toolchain }} llvm-cov --workspace --all-features --codecov --output-path codecov.json | ||
|
||
# Test workspace and generate LCOV coverage file | ||
[group("test")] | ||
test-coverage-lcov toolchain="": | ||
cargo {{ toolchain }} llvm-cov --workspace --all-features --lcov --output-path lcov.info | ||
|
||
# Document crates in workspace. | ||
[group("docs")] | ||
doc *args: | ||
RUSTDOCFLAGS="--cfg=docsrs -Dwarnings" cargo +nightly doc --workspace --all-features {{ args }} |
Oops, something went wrong.