chore: add --all-features and --cfg docsrs to cargo doc CI workflow (#526)

Tower's docs builds are currently failing on `master` because of broken
docs links. These links are broken because they reference modules that
are feature flagged and disabled by default.

In order to build docs successfully, we should build with
`--all-features`. This also means we'll actually build docs for feature
flagged modules --- because we weren't doing that previously, we
actually weren't building most of the docs on CI.

Additionally, I've changed the docs build workflow to build on nightly and
to set `RUSTDOCFLAGS="--cfg docsrs"` so that we can use `doc(cfg)`
attributes when building the Git API docs.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
Eliza Weisman
2021-01-12 10:42:42 -08:00
committed by GitHub
parent b4169c7753
commit 0ad132bdbe

View File

@@ -17,7 +17,11 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: doc
args: --workspace --no-deps
args: --workspace --no-deps --all-features
# Tower uses nightly-only RustDoc features
toolchain: nightly
env:
RUSTDOCFLAGS: --cfg docsrs
- name: Deploy documentation
if: success()
uses: crazy-max/ghaction-github-pages@v1