Skip to content

Commit

Permalink
Merge pull request #712 from uuid-rs/ci/miri-clippy
Browse files Browse the repository at this point in the history
Replace MIPS with Miri and add clippy to CI
  • Loading branch information
KodrAus committed Oct 17, 2023
2 parents 1d4bd6e + 0c5b2df commit a8d2e1d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
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

0 comments on commit a8d2e1d

Please sign in to comment.