From d75d6da39e0962453807f24b8d638c2277344d1b Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Sat, 31 Aug 2024 12:48:36 +0200 Subject: [PATCH] ci: Enable doctests Unfortunately nextest does not support doc tests yet, they need to be run using cargo test. --- .github/workflows/test_rust.yml | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test_rust.yml b/.github/workflows/test_rust.yml index 1132a25d61ba..d1b702013296 100644 --- a/.github/workflows/test_rust.yml +++ b/.github/workflows/test_rust.yml @@ -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: @@ -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()