diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ceef1ad..34a99427 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -167,17 +167,14 @@ jobs: os: - ubuntu - macOS - # TODO: Re-enable once rust-lang/rust#99466 is fixed: - # https://github.com/rust-lang/rust/issues/99466 - # - windows + - windows runs-on: ${{ matrix.os }}-latest steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@v1 with: toolchain: stable - - - run: cargo install mdbook + - uses: peaceiris/actions-mdbook@v1 - run: make test.book diff --git a/Makefile b/Makefile index 5f69d5d6..86f9ff28 100644 --- a/Makefile +++ b/Makefile @@ -110,8 +110,13 @@ test.book: ifeq ($(clean),yes) cargo clean endif + $(eval target := $(strip $(shell cargo -vV | sed -n 's/host: //p'))) cargo build --all-features --tests - OUT_DIR=target mdbook test book -L target/debug/deps + mdbook test book -L target/debug/deps $(strip \ + $(if $(call eq,$(findstring windows,$(target)),),,\ + $(shell cargo metadata -q \ + | jq -r '.packages[] | select(.name == "windows_$(word 1,$(subst -, ,$(target)))_$(word 4,$(subst -, ,$(target)))") | .manifest_path' \ + | sed -e "s/^/-L '/" -e 's/Cargo.toml/lib/' -e "s/$$/'/" ))) diff --git a/book/README.md b/book/README.md index 80669c7f..809ef9bb 100644 --- a/book/README.md +++ b/book/README.md @@ -48,7 +48,7 @@ To run the tests validating all code examples in the book, run (from project roo ```bash cargo build --all-features --tests -OUT_DIR=target mdbook test -L target/debug/deps +mdbook test -L target/debug/deps # or via shortcut: make test.book diff --git a/src/lib.rs b/src/lib.rs index 15521fac..2aba2727 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -133,6 +133,7 @@ pub mod codegen; #[cfg(test)] mod actually_used_crates_in_tests { use humantime as _; + use rand as _; use tempfile as _; use tokio as _; }