From 97c5159d927a8e1362716126a4e8af53056869f3 Mon Sep 17 00:00:00 2001 From: Serhii Potapov Date: Sun, 25 Aug 2024 11:30:23 +0200 Subject: [PATCH 1/3] Adjust Justfile to run doc tests --- Justfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Justfile b/Justfile index 1de0d6c..7f3ad20 100644 --- a/Justfile +++ b/Justfile @@ -1,7 +1,11 @@ all: fmt test-all clippy examples typos -test-all: +test-all: test test-features test-ui test-doc + +test: cargo test + +test-features: cargo test --features serde cargo test --features regex cargo test --features new_unchecked @@ -9,12 +13,14 @@ test-all: cargo test --features arbitrary cargo test --all-features -test: - cargo test test-ui: cargo test --features ui +test-doc: + cd nutype && cargo test --doc + cd nutype_macros && cargo test --doc + fmt: cargo fmt From 4a37a130c2f5105368b4c4b2f43473c2c6c82c2f Mon Sep 17 00:00:00 2001 From: Serhii Potapov Date: Sun, 25 Aug 2024 11:33:58 +0200 Subject: [PATCH 2/3] Adjust ci.yml to run doc tests --- .github/workflows/ci.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da39003..7075281 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,6 +60,28 @@ jobs: command: test args: --all-features + doctests: + name: Doctests + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Run doctests for nutype + run: | + cd nutype + cargo test --doc + + - name: Run doctests for nutype_macros + run: | + cd nutype_macros + cargo test --doc + rustfmt: name: Rustfmt runs-on: ubuntu-latest @@ -134,4 +156,3 @@ jobs: - name: typos-action uses: crate-ci/typos@v1.17.0 - From c76712477a811ac9b6c8065b455e0a4154b30a53 Mon Sep 17 00:00:00 2001 From: Serhii Potapov Date: Sun, 25 Aug 2024 12:56:26 +0200 Subject: [PATCH 3/3] Run doctests with --all-features --- .github/workflows/ci.yml | 4 ++-- Justfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7075281..3e6e84f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,12 +75,12 @@ jobs: - name: Run doctests for nutype run: | cd nutype - cargo test --doc + cargo test --doc --all-features - name: Run doctests for nutype_macros run: | cd nutype_macros - cargo test --doc + cargo test --doc --all-features rustfmt: name: Rustfmt diff --git a/Justfile b/Justfile index 7f3ad20..84a5446 100644 --- a/Justfile +++ b/Justfile @@ -18,8 +18,8 @@ test-ui: cargo test --features ui test-doc: - cd nutype && cargo test --doc - cd nutype_macros && cargo test --doc + cd nutype && cargo test --doc --all-features + cd nutype_macros && cargo test --doc --all-features fmt: cargo fmt