From bb9cdbb0870a8a0301c02073c306a72b051b6b22 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Wed, 17 Jul 2024 14:35:24 -0600 Subject: [PATCH] Ch. 17: Update CI config to support testing the book with `trpl` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/main.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77495c09aa..5e86a76760 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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