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:
|
os:
|
||||||
- ubuntu
|
- ubuntu
|
||||||
- macOS
|
- macOS
|
||||||
# TODO: Re-enable once rust-lang/rust#99466 is fixed:
|
- windows
|
||||||
# https://github.com/rust-lang/rust/issues/99466
|
|
||||||
#- windows
|
|
||||||
toolchain:
|
toolchain:
|
||||||
- stable
|
- stable
|
||||||
- beta
|
- beta
|
||||||
|
@ -277,8 +275,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.toolchain }}
|
toolchain: ${{ matrix.toolchain }}
|
||||||
- run: rustup default ${{ matrix.toolchain }}
|
- run: rustup default ${{ matrix.toolchain }}
|
||||||
|
- uses: peaceiris/actions-mdbook@v1
|
||||||
- run: cargo install mdbook
|
|
||||||
|
|
||||||
- run: make test.book
|
- run: make test.book
|
||||||
|
|
||||||
|
|
7
Makefile
7
Makefile
|
@ -93,8 +93,13 @@ test.book:
|
||||||
ifeq ($(clean),yes)
|
ifeq ($(clean),yes)
|
||||||
cargo clean
|
cargo clean
|
||||||
endif
|
endif
|
||||||
|
$(eval target := $(strip $(shell cargo -vV | sed -n 's/host: //p')))
|
||||||
cargo build
|
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.
|
# Run Rust tests of project crates.
|
||||||
|
|
|
@ -45,10 +45,11 @@ The output will be in the `_rendered/` directory.
|
||||||
|
|
||||||
### Testing
|
### 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
|
```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
|
make test.book
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue