Skip to content

Commit 94544d6

Browse files
committed
ci: Enable doctests
Unfortunately nextest does not support doc tests yet, they need to be run using cargo test.
1 parent 679fb19 commit 94544d6

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

.github/workflows/test_rust.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ concurrency:
1212

1313
env:
1414
FEATURES: lzma,jpegxr
15+
TEST_OPTS: --workspace --locked --no-fail-fast -j 4
16+
17+
# This is to counteract the disabling by rust-cache.
18+
# See: https://github.com/Swatinem/rust-cache/issues/43
19+
CARGO_INCREMENTAL: '1'
20+
21+
# Supposedly makes "Updating crates.io index" faster on Windows.
22+
# See: https://github.com/rust-lang/cargo/issues/9167
23+
CARGO_NET_GIT_FETCH_WITH_CLI: 'true'
24+
25+
# Workaround for: https://github.com/nextest-rs/nextest/issues/1493
26+
# See also: https://github.com/rust-lang/rustup/issues/3825
27+
RUSTUP_WINDOWS_PATH_ADD_BIN: '1'
28+
29+
# (Linux) Just to silence warnings about it missing
30+
XDG_RUNTIME_DIR: ''
1531

1632
jobs:
1733
changes:
@@ -88,18 +104,11 @@ jobs:
88104

89105
- name: Run tests
90106
shell: bash
91-
run: cargo nextest run --profile ci --cargo-profile ci --workspace --locked --no-fail-fast -j 4 --features ${FEATURES}
92-
env:
93-
# This is to counteract the disabling by rust-cache.
94-
# See: https://github.com/Swatinem/rust-cache/issues/43
95-
CARGO_INCREMENTAL: '1'
96-
# Supposedly makes "Updating crates.io index" faster on Windows.
97-
# See: https://github.com/rust-lang/cargo/issues/9167
98-
CARGO_NET_GIT_FETCH_WITH_CLI: 'true'
99-
# Workaround for: https://github.com/nextest-rs/nextest/issues/1493
100-
# See also: https://github.com/rust-lang/rustup/issues/3825
101-
RUSTUP_WINDOWS_PATH_ADD_BIN: '1'
102-
XDG_RUNTIME_DIR: '' # dummy value, just to silence warnings about it missing
107+
run: cargo nextest run --profile ci --cargo-profile ci ${TEST_OPTS} --features ${FEATURES}
108+
109+
- name: Run doctests
110+
shell: bash
111+
run: cargo test --doc --profile ci ${TEST_OPTS} --features ${FEATURES}
103112

104113
- name: Upload images
105114
if: failure()

0 commit comments

Comments
 (0)