Skip to content

Commit f680654

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

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:
@@ -89,18 +105,11 @@ jobs:
89105

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

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

0 commit comments

Comments
 (0)