Skip to content

Commit c40d350

Browse files
committed
CI: Build the docs
Add docs build to the ci script, guard with env var `DO_DOCS` as we do in other crates in the stack. Add a docs build job to the CI configuration using the nightly toolchain as required.
1 parent 3ff4f14 commit c40d350

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.github/workflows/rust.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,26 @@ jobs:
2727
DO_LINT: true
2828
run: ./contrib/test.sh
2929

30-
bench_nightly:
31-
name: Bench + Tests
30+
Nightly:
31+
name: Bench + Docs
3232
runs-on: ubuntu-latest
33-
strategy:
34-
matrix:
35-
rust:
36-
- nightly
3733
steps:
3834
- name: Checkout Crate
3935
uses: actions/checkout@v2
4036
- name: Checkout Toolchain
4137
uses: actions-rs/toolchain@v1
4238
with:
4339
profile: minimal
44-
toolchain: ${{ matrix.rust }}
40+
toolchain: nightly
4541
override: true
46-
- name: Running cargo test
42+
- name: Running benchmarks
4743
env:
4844
DO_BENCH: true
4945
run: ./contrib/test.sh
46+
- name: Building docs
47+
env:
48+
DO_DOCS: true
49+
run: ./contrib/test.sh
5050

5151
UnitTests:
5252
name: Tests

contrib/test.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,17 @@ cargo build --examples
4444
# run all examples
4545
run-parts ./target/debug/examples
4646

47-
# Bench if told to
47+
# Bench if told to (this only works with the nightly toolchain)
4848
if [ "$DO_BENCH" = true ]
4949
then
5050
cargo bench --features="unstable compiler"
5151
fi
5252

53+
# Build the docs if told to (this only works with the nightly toolchain)
54+
if [ "$DO_DOCS" = true ]; then
55+
RUSTDOCFLAGS="--cfg docsrs" cargo doc --all --features="$FEATURES"
56+
fi
57+
5358
# Run Integration tests if told so
5459
if [ -n "$BITCOINVERSION" ]; then
5560
set -e

0 commit comments

Comments
 (0)