Fix mdBook tests on Windows (rust-lang/rust#99466)
This commit is contained in:
parent
e7cfa20254
commit
e3a72edf70
3 changed files with 12 additions and 9 deletions
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
|
@ -263,9 +263,7 @@ jobs:
|
|||
os:
|
||||
- ubuntu
|
||||
- macOS
|
||||
# TODO: Re-enable once rust-lang/rust#99466 is fixed:
|
||||
# https://github.com/rust-lang/rust/issues/99466
|
||||
#- windows
|
||||
- windows
|
||||
toolchain:
|
||||
- stable
|
||||
- beta
|
||||
|
@ -277,8 +275,7 @@ jobs:
|
|||
with:
|
||||
toolchain: ${{ matrix.toolchain }}
|
||||
- run: rustup default ${{ matrix.toolchain }}
|
||||
|
||||
- run: cargo install mdbook
|
||||
- uses: peaceiris/actions-mdbook@v1
|
||||
|
||||
- run: make test.book
|
||||
|
||||
|
|
7
Makefile
7
Makefile
|
@ -93,8 +93,13 @@ test.book:
|
|||
ifeq ($(clean),yes)
|
||||
cargo clean
|
||||
endif
|
||||
$(eval target := $(strip $(shell cargo -vV | sed -n 's/host: //p')))
|
||||
cargo build
|
||||
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/$$/'/" )))
|
||||
|
||||
|
||||
# Run Rust tests of project crates.
|
||||
|
|
|
@ -45,10 +45,11 @@ The output will be in the `_rendered/` directory.
|
|||
|
||||
### Testing
|
||||
|
||||
To run the tests validating all code examples in the book, run:
|
||||
To run the tests validating all code examples in the book, run (from project root dir):
|
||||
```bash
|
||||
mdbook test -L ../target/debug/deps
|
||||
cargo build
|
||||
mdbook test -L target/debug/deps
|
||||
|
||||
# or via shortcut from project root dir:
|
||||
# or via shortcut:
|
||||
make test.book
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue