Skip to content

Fix CI: modernize workflow, fix clippy/sort violations, repair no_std build#6

Merged
lthiery merged 1 commit into
mainfrom
fix-ci
Jul 7, 2026
Merged

Fix CI: modernize workflow, fix clippy/sort violations, repair no_std build#6
lthiery merged 1 commit into
mainfrom
fix-ci

Conversation

@lthiery

@lthiery lthiery commented Jul 7, 2026

Copy link
Copy Markdown
Owner

CI has been red since June 2025. The job died in under a minute — before clippy or tests ever ran — at the `cargo install cargo-sort` step, and the workflow also leaned on two archived actions (`actions-rs/clippy-check@v1`, `styfle/cancel-workflow-action@0.9.1`) running deprecated Node runtimes.

Workflow

  • `cargo-sort` installed via `taiki-e/install-action` (prebuilt binary, seconds instead of a from-source build)
  • archived actions replaced: plain `cargo clippy` invocation + a `concurrency` group for run cancellation
  • `cargo sort --check` now gets `--workspace` — without it, only the virtual root manifest was checked, i.e. nothing
  • clippy gets `--all-targets` (lint tests too), tests run with `--all-features` (exercises serde)
  • new step: `cargo check -p humanbyte --no-default-features`

Code fixes the tightened CI required

  • two `MB as u64` unnecessary casts in bytescale tests (clippy `-Dclippy::all` with `--all-targets`)
  • member `Cargo.toml`s sorted
  • no_std was broken: `f64::ln()` doesn't exist in `core`, so `humanbyte` without the `std` feature never compiled. The unit exponent is now computed with an exact integer loop (identical display output — all existing display assertions pass unchanged). Also dropped the duplicate `#![no_std]`/`cfg_attr` attribute pair.

All steps verified locally: fmt, sort, clippy, tests (12 pass incl. serde), no_std check.

… build

- Replace archived actions-rs/clippy-check and styfle/cancel-workflow-action
  (deprecated Node runtimes) with plain cargo clippy and a concurrency group
- Install cargo-sort via taiki-e/install-action (prebuilt binary) instead of
  compiling from source, which was failing the job in under a minute
- Run cargo sort with --workspace so member manifests are actually checked,
  and sort them
- Lint tests too (--all-targets) and fix the two unnecessary u64 casts
- Test with --all-features so the serde path is exercised
- Fix no_std build: f64::ln does not exist in core; compute the unit
  exponent with an exact integer loop instead. Drop the duplicate no_std
  attribute. Add a no-default-features check step to CI.
@lthiery lthiery merged commit 65e2df2 into main Jul 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant