Skip to content

Commit bb9cdbb

Browse files
committed
Ch. 17: Update CI config to support testing the book with trpl
mdBook does not currently have particularly good support for “external” crates. To make the test suite work correctly with `trpl`, we must first build `trpl` itself (`mdbook` will not do it), and then explicitly pass its `deps` path as a library search path for `mdbook test`. That will make sure all the crates can be resolved when running the tests. .github/workflows/main.yml
1 parent dc8d7e8 commit bb9cdbb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/main.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,19 @@ jobs:
2424
rustup --version
2525
rustc -Vv
2626
mdbook --version
27+
28+
# mdBook does not currently have particularly good support for “external”
29+
# crates. To make the test suite work correctly with `trpl`, we must first
30+
# build `trpl` itself (`mdbook` will not do it), and then explicitly pass
31+
# its `deps` path as a library search path for `mdbook test`. That will make
32+
# sure all the crates can be resolved when running the tests.
33+
- name: Build `trpl` crate
34+
run: |
35+
cd packages/trpl
36+
cargo build
2737
- name: Run tests
28-
run: mdbook test
38+
run:
39+
mdbook test --library-path packages/trpl/target/debug/deps
2940
package_tests:
3041
name: Run package tests
3142
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)