Skip to content

Commit

Permalink
Ch. 17: Update CI config to support testing the book with trpl
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chriskrycho committed Jul 17, 2024
1 parent dc8d7e8 commit bb9cdbb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,19 @@ jobs:
rustup --version
rustc -Vv
mdbook --version
# 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.
- name: Build `trpl` crate
run: |
cd packages/trpl
cargo build
- name: Run tests
run: mdbook test
run:
mdbook test --library-path packages/trpl/target/debug/deps
package_tests:
name: Run package tests
runs-on: ubuntu-latest
Expand Down

0 comments on commit bb9cdbb

Please sign in to comment.