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

Improve CI with proper test jobs + fmt/doc/clippy #48

Merged
merged 3 commits into from
Jul 18, 2024
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
74 changes: 64 additions & 10 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,73 @@
name: Rust

permissions:
contents: read

on: [push, pull_request]

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTUP_MAX_RETRIES: 10

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
build:
test:
strategy:
matrix:
os: [ubuntu, windows, macos]
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: rust-lang/simpleinfra/github-actions/simple-ci@master
- name: "32-bit cross testing"
run: |
rustup toolchain install nightly
rustup override set nightly
rustup component add miri
cargo +nightly miri test --target i686-unknown-linux-gnu
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- run: cargo check
- run: cargo test
- run: rustup update nightly && rustup default nightly
- run: cargo test --all-features
cross-test:
strategy:
matrix:
os: [ubuntu, windows, macos]
target: [
"x86_64-unknown-linux-gnu", # 64-bits, little-endian
"i686-unknown-linux-gnu", # 32-bits, little-endian
"mips-unknown-linux-gnu", # 32-bits, big-endian
"mips64-unknown-linux-gnuabi64", # 64-bits, big-endian
]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: install miri
run: rustup toolchain add nightly --no-self-update --component miri && rustup default nightly
- run: |
cargo miri test --target=${{ matrix.target }} --all-features
env:
MIRIFLAGS: -Zmiri-strict-provenance
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -Z randomize-layout
RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- run: rustup component add rustfmt
- run: cargo fmt --all --check
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- run: cargo doc --workspace --document-private-items --no-deps
env:
RUSTDOCFLAGS: -D warnings
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- run: rustup component add clippy
- run: cargo clippy --workspace --all-targets --no-deps
2 changes: 1 addition & 1 deletion src/seeded_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub type FxHashMapSeed<K, V> = std::collections::HashMap<K, V, FxSeededState>;
#[cfg(feature = "std")]
pub type FxHashSetSeed<V> = std::collections::HashSet<V, FxSeededState>;

/// [`FxSetState`] is an alternative state for `HashMap` types, allowing to use [`FxHasher`] with a set seed.
/// [`FxSeededState`] is an alternative state for `HashMap` types, allowing to use [`FxHasher`] with a set seed.
///
/// ```
/// # use std::collections::HashMap;
Expand Down