From 3bdfdef02e3d21a5acb833457fc7581305354517 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Mon, 4 Jan 2021 21:30:44 +0900 Subject: [PATCH] Separate check for docs into its own job --- .github/workflows/ci.yml | 12 ++++++++++++ ci/docs.sh | 8 ++++++++ ci/test.sh | 2 -- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 ci/docs.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 347e97a04..a9fac3f6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,6 +117,17 @@ jobs: - name: loom run: ./ci/crossbeam-epoch-loom.sh + # Check if the document can be generated without warning. + docs: + name: docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Rust + run: rustup update nightly && rustup default nightly + - name: docs + run: ./ci/docs.sh + # This job doesn't actually test anything, but they're used to tell bors the # build completed, as there is no practical way to detect when a workflow is # successful listening to webhooks only. @@ -133,6 +144,7 @@ jobs: - rustfmt - clippy - loom + - docs runs-on: ubuntu-latest steps: - name: Mark the job as a success diff --git a/ci/docs.sh b/ci/docs.sh new file mode 100755 index 000000000..7cd5c4df7 --- /dev/null +++ b/ci/docs.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +cd "$(dirname "$0")"/.. +set -ex + +export RUSTDOCFLAGS="-D warnings" + +cargo doc --no-deps --all --all-features diff --git a/ci/test.sh b/ci/test.sh index 8f2075f79..a08d4c4a1 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -22,8 +22,6 @@ if [[ "$RUST_VERSION" == "nightly"* ]]; then # Some crates have `nightly` feature, so run tests with --all-features. cargo test --all --all-features --exclude benchmarks -- --test-threads=1 - RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all --all-features - # Benchmarks are only checked on nightly because depending on unstable features. cargo check --all --benches cd crossbeam-channel/benchmarks