Skip to content

Commit

Permalink
CI: Move rustdoc tests to a separate matrix.
Browse files Browse the repository at this point in the history
Only build/run rustdoc tests once, instead of in every `test` matrix entry.
  • Loading branch information
briansmith committed Jan 3, 2024
1 parent a3d034d commit 79fb261
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,6 @@ jobs:
run: |
cargo +${{ matrix.rust_channel }} test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
# --all-targets doesn't run doctests: https://github.com/rust-lang/cargo/issues/6669
# Run doctests only on x86_64 to avoid cross-compilation hassles with `--no-run`.
- if: ${{ !contains(matrix.host_os, 'windows') && contains(matrix.target, 'x86_64') }}
run: |
mk/cargo.sh +${{ matrix.rust_channel }} test -vv --doc --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
# Check that all the needed symbol renaming was done.
# TODO: Do this check on Windows too.
# TODO: Check iOS too.
Expand Down Expand Up @@ -308,6 +302,30 @@ jobs:

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

test-doc:
# Don't run duplicate `push` jobs for the repo owner's PRs.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

runs-on: ubuntu-22.04

strategy:
matrix:
rust_channel:
- stable
- nightly

steps:
- run: sudo apt-get update -y

- run: rustup toolchain add --profile=minimal ${{ matrix.rust_channel }}

- uses: briansmith/actions-checkout@v4
with:
persist-credentials: false

- run: |
cargo +${{ matrix.rust_channel }} test -vv --doc
# XXX: GitHub Actions won't let us test all the combinations of features in
# the "test" matrix because the resultant matrix would be larger than the
# maximum they allow.
Expand Down

0 comments on commit 79fb261

Please sign in to comment.