Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace MIPS with Miri and add clippy to CI #712

Merged
merged 2 commits into from
Oct 17, 2023
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
34 changes: 27 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
run: cargo hack test --lib --all-features

stable:
name: "Tests / Stable"
name: Tests / Stable
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand All @@ -78,7 +78,7 @@ jobs:
run: cargo test --all-features

msrv:
name: "Build / MSRV"
name: Build / MSRV
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand Down Expand Up @@ -134,18 +134,38 @@ jobs:
- name: Fast RNG
run: cargo test --target wasm32-wasi --features "v4 fast-rng"

mips:
name: Tests / MIPS (Big Endian)
miri:
name: Tests / Miri
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab

- name: Install Cross
run: cargo install cross
- name: Install Miri
run: |
rustup toolchain install nightly --component miri
cargo +nightly miri setup

- name: Default features
run: cross test --target mips-unknown-linux-gnu
run: cargo +nightly miri test

- name: BE
run: cargo +nightly miri test --target s390x-unknown-linux-gnu

clippy:
name: Build / Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab

- name: Install Clippy
run: |
rustup update beta
rustup component add clippy --toolchain beta

- name: Default features
run: cargo +beta clippy --all-features

embedded:
name: Build / Embedded
Expand Down
6 changes: 2 additions & 4 deletions src/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,9 @@ impl Timestamp {

#[cfg(any(feature = "v1", feature = "v6"))]
const fn unix_to_rfc4122_ticks(seconds: u64, nanos: u32) -> u64 {
let ticks = UUID_TICKS_BETWEEN_EPOCHS
UUID_TICKS_BETWEEN_EPOCHS
.wrapping_add(seconds.wrapping_mul(10_000_000))
.wrapping_add(nanos as u64 / 100);

ticks
.wrapping_add(nanos as u64 / 100)
}

const fn rfc4122_to_unix(ticks: u64) -> (u64, u32) {
Expand Down