Build the docs with test.sh

We currently build the docs as a separate CI job, we can however just do
it as part of the `Tests` job using the nightly toolchain.

Conditionally build the docs based on a `DO_DOCS` env var.

Note, uses `--cfg docsrs` so can only be built run with nightly toolchain.
This commit is contained in:
Tobin Harding 2022-03-08 15:36:54 +11:00
parent 8163497ab3
commit 0d36455d74
2 changed files with 6 additions and 14 deletions

View File

@ -24,6 +24,7 @@ jobs:
DO_BENCH: true
AS_DEPENDENCY: true
DO_NO_STD: true
DO_DOCS: true
- rust: 1.29.0
env:
AS_DEPENDENCY: true
@ -82,20 +83,6 @@ jobs:
- name: run cross test
run: cross test --target s390x-unknown-linux-gnu
Docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v2
- name: Checkout Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Create Doc
run: cargo doc
Embedded:
runs-on: ubuntu-latest
steps:

View File

@ -67,6 +67,11 @@ do
cargo test --verbose --features="$feature"
done
# Build the docs if told to (this only works with the nightly toolchain)
if [ "$DO_DOCS" = true ]; then
RUSTDOCFLAGS="--cfg docsrs" cargo doc --all --features="$FEATURES"
fi
# Fuzz if told to
if [ "$DO_FUZZ" = true ]
then