Skip to content

Commit 7f8fb38

Browse files
committed
CI: Move rustdoc tests to a separate matrix.
Only build/run rustdoc tests once, instead of in every `test` matrix entry.
1 parent a206284 commit 7f8fb38

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,6 @@ jobs:
271271
run: |
272272
cargo +${{ matrix.rust_channel }} test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
273273
274-
# --all-targets doesn't run doctests: https://github.com/rust-lang/cargo/issues/6669
275-
# Run doctests only on x86_64 to avoid cross-compilation hassles with `--no-run`.
276-
- if: ${{ !contains(matrix.host_os, 'windows') && contains(matrix.target, 'x86_64') }}
277-
run: |
278-
mk/cargo.sh +${{ matrix.rust_channel }} test -vv --doc --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
279-
280274
# Check that all the needed symbol renaming was done.
281275
# TODO: Do this check on Windows too.
282276
# TODO: Check iOS too.
@@ -308,6 +302,30 @@ jobs:
308302

309303
- run: cargo test -p ring-bench --all-features --all-targets
310304

305+
test-doc:
306+
# Don't run duplicate `push` jobs for the repo owner's PRs.
307+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
308+
309+
runs-on: ubuntu-22.04
310+
311+
strategy:
312+
matrix:
313+
rust_channel:
314+
- stable
315+
- nightly
316+
317+
steps:
318+
- run: sudo apt-get update -y
319+
320+
- run: rustup toolchain add --profile=minimal ${{ matrix.rust_channel }}
321+
322+
- uses: briansmith/actions-checkout@v4
323+
with:
324+
persist-credentials: false
325+
326+
- run: |
327+
cargo +${{ matrix.rust_channel }} test -vv --doc --all-features
328+
311329
# XXX: GitHub Actions won't let us test all the combinations of features in
312330
# the "test" matrix because the resultant matrix would be larger than the
313331
# maximum they allow.

0 commit comments

Comments
 (0)