Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsonin committed Apr 22, 2024
0 parents commit 84dcfbb
Show file tree
Hide file tree
Showing 26 changed files with 4,436 additions and 0 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: 1
RUST_LOG: blazemap

jobs:
fmt:
name: "Fmt"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup show active-toolchain -v
- run: rustup component add rustfmt
- run: cargo fmt --version
- run: cargo fmt -- --check

build:
name: "Build"
needs: fmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build project
run: cargo build --all-targets --all-features

docs:
name: "Docs"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Documentation
run: cargo doc --all --no-deps --release

clippy:
name: "Clippy"
needs: fmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Add clippy
run: rustup component add clippy
- name: Clippy version
run: cargo clippy --version
- name: Run clippy
run: cargo clippy
- name: Run clippy with all features
run: cargo clippy --all-targets --all-features
- name: Run clippy on tests
run: cargo clippy --tests --all-targets --all-features

tests:
name: "Tests"
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run tests
run: cargo test
- name: Run tests with all features
run: cargo test --all-features
- name: Run tests with all features in release mode
run: cargo test --all-features --release

loom:
name: "Loom"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup show active-toolchain -v
- run: ./tests/loom.sh

miri:
name: "Miri"
needs: clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Miri
run: |
rustup toolchain install nightly --component miri
rustup override set nightly
cargo miri setup
- name: Run tests with Miri
run: cargo miri test --all-features
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# macOS Finder files
.DS_Store

# JetBrains files
.idea/
39 changes: 39 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[package]
name = "blazemap"
version = "0.3.0"
authors = ["Andrew Sonin <[email protected]>"]
categories = ["data-structures"]
description = """
Implements a vector-based slab-like map with an interface similar to that of HashMap, \
and also provides tools for generating lightweight identifiers that can be type-safely used as keys for this map.
"""
keywords = ["map", "slab", "hashmap"]
license = "MIT"
repository = "https://github.com/andrewsonin/blazemap"
readme = "README.md"
edition = "2021"

[lints.rust]
rust_2018_idioms = "warn"
unreachable_pub = "warn"
missing_docs = "warn"
missing_debug_implementations = "warn"

[lints.clippy]
pedantic = { level = "warn", priority = -1 }

[dependencies]
once_cell = "1"
parking_lot = "0.12"
serde = { version = "1", optional = true, features = ["derive"] }

[target.'cfg(loom)'.dependencies]
loom = { version = "0.7", features = ["checkpoint"] }

[dev-dependencies]
rand = "0.8"
serde_json = "1"
static_assertions = "1"

[features]
serde = ["dep:serde"]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# blazemap

_Implements a vector-based slab-like map with an interface similar to that of `HashMap`,
and also provides tools for generating lightweight identifiers that can be type-safely used as keys for this map._
2 changes: 2 additions & 0 deletions src/collections.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// Defines [`BlazeMap`](crate::prelude::BlazeMap).
pub mod blazemap;
Loading

0 comments on commit 84dcfbb

Please sign in to comment.