Skip to content

Commit

Permalink
ci: Enable doctests
Browse files Browse the repository at this point in the history
Unfortunately nextest does not support doc tests yet, they need to be
run using cargo test.
  • Loading branch information
kjarosh authored and torokati44 committed Sep 4, 2024
1 parent 7d5059a commit d75d6da
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions .github/workflows/test_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ concurrency:

env:
FEATURES: lzma,jpegxr
TEST_OPTS: --workspace --locked --no-fail-fast -j 4

# This is to counteract the disabling by rust-cache.
# See: https://github.com/Swatinem/rust-cache/issues/43
CARGO_INCREMENTAL: '1'

# Supposedly makes "Updating crates.io index" faster on Windows.
# See: https://github.com/rust-lang/cargo/issues/9167
CARGO_NET_GIT_FETCH_WITH_CLI: 'true'

# Workaround for: https://github.com/nextest-rs/nextest/issues/1493
# See also: https://github.com/rust-lang/rustup/issues/3825
RUSTUP_WINDOWS_PATH_ADD_BIN: '1'

# (Linux) Just to silence warnings about it missing
XDG_RUNTIME_DIR: ''

jobs:
changes:
Expand Down Expand Up @@ -88,18 +104,11 @@ jobs:

- name: Run tests
shell: bash
run: cargo nextest run --profile ci --cargo-profile ci --workspace --locked --no-fail-fast -j 4 --features ${FEATURES}
env:
# This is to counteract the disabling by rust-cache.
# See: https://github.com/Swatinem/rust-cache/issues/43
CARGO_INCREMENTAL: '1'
# Supposedly makes "Updating crates.io index" faster on Windows.
# See: https://github.com/rust-lang/cargo/issues/9167
CARGO_NET_GIT_FETCH_WITH_CLI: 'true'
# Workaround for: https://github.com/nextest-rs/nextest/issues/1493
# See also: https://github.com/rust-lang/rustup/issues/3825
RUSTUP_WINDOWS_PATH_ADD_BIN: '1'
XDG_RUNTIME_DIR: '' # dummy value, just to silence warnings about it missing
run: cargo nextest run --profile ci --cargo-profile ci ${TEST_OPTS} --features ${FEATURES}

- name: Run doctests
shell: bash
run: cargo test --doc --profile ci ${TEST_OPTS} --features ${FEATURES}

- name: Upload images
if: failure()
Expand Down

0 comments on commit d75d6da

Please sign in to comment.