Skip to content
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
33 changes: 28 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
name: Continuous integration
on: [push, pull_request]

env:
RUSTFLAGS: "-Dwarnings"
RUSTDOCFLAGS: "-Dwarnings"

permissions:
contents: read

jobs:
ci:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: dtolnay/rust-toolchain@e814c742d4444ce2f3f6abddea7faf00161ed941 # 1.88.0
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- run: cargo test --workspace --all-features --no-run
- run: cargo test --workspace --all-features --no-fail-fast
- run: git diff --exit-code

checks:
name: Check clippy, formatting, and documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.88.0
- run: cargo build --all-features
- run: cargo test --all-features
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: dtolnay/rust-toolchain@e814c742d4444ce2f3f6abddea7faf00161ed941 # 1.88.0
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- run: cargo clippy --workspace --all-targets --all-features
- run: cargo fmt --check --all
- run: cargo doc --workspace --no-deps
6 changes: 3 additions & 3 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ use syn::{Error, Result, parse_quote};
/// arguments.
///
/// # Example
/// ```
/// ```ignore
/// /// Evaluate a `.calc` script.
/// #[comemo::memoize]
/// fn evaluate(script: &str, files: comemo::Tracked<Files>) -> i32 {
Expand Down Expand Up @@ -120,7 +120,7 @@ use syn::{Error, Result, parse_quote};
/// and caching.
///
/// ## Example
/// ```
/// ```ignore
/// /// Compute the sum of a slice of floats, but only memoize if the slice is
/// /// longer than 1024 elements.
/// #[comemo::memoize(enabled = add.len() > 1024)]
Expand Down Expand Up @@ -188,7 +188,7 @@ pub fn memoize(args: BoundaryStream, stream: BoundaryStream) -> BoundaryStream {
/// - They cannot use destructuring patterns in their arguments.
///
/// # Example
/// ```
/// ```ignore
/// /// File storage.
/// struct Files(HashMap<PathBuf, String>);
///
Expand Down
2 changes: 1 addition & 1 deletion src/accelerate.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::sync::atomic::{AtomicUsize, Ordering};

use rustc_hash::FxHashMap;
use parking_lot::{MappedRwLockReadGuard, Mutex, RwLock, RwLockReadGuard};
use rustc_hash::FxHashMap;

/// The global list of currently alive accelerators.
static ACCELERATORS: RwLock<(usize, Vec<Accelerator>)> = RwLock::new((0, Vec::new()));
Expand Down
Loading