Merge rust-bitcoin/rust-bitcoin#858: Build the docs with test.sh

0d36455d74 Build the docs with test.sh (Tobin Harding)
8163497ab3 Use correct indentation (Tobin Harding)
3786680cc7 Use correct script name (Tobin Harding)

Pull request description:

  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.

  - Patch 1: Fixes the incorrect file naming `ci.sh` -> `test.sh` in `CONTRIBUTING.md`.
  - Patch 2 - 4: Do trivial cleanup of `test.sh`.
  - Patch 5: Does the fix described above.

  Resolves: #850

ACKs for top commit:
  Kixunil:
    ACK 0d36455d74
  apoelstra:
    ACK 0d36455d74
  dr-orlovsky:
    ACK 0d36455d74

Tree-SHA512: c33c8df687c2115477eae9888b80d4e744d7b68b598694cf17220dd11098f33ba23c0b33e6f7d291572187942c472d1bc9cbb5217d3d83d41906a97c0b3417e5
This commit is contained in:
Dr. Maxim Orlovsky 2022-03-12 12:44:30 +02:00
commit a8c9ea6b91
No known key found for this signature in database
GPG Key ID: AF91255DEA466640
3 changed files with 23 additions and 31 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

@ -128,7 +128,7 @@ PR authors may also find it useful to run the following script locally in order
to check that each of the commits within the PR satisfies the requirements
above, before submitting the PR to review:
```shell script
BITCOIN_MSRV=1.29.0 ./contrib/ci.sh
BITCOIN_MSRV=1.29.0 ./contrib/test.sh
```
Please replace the value in `BITCOIN_MSRV=1.29.0` with the current MSRV from
[README.md].

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