Fix CI to run doctests again (#5410)

The faster `cargo nextest` currently doesn't support running the doctests.

Thus, add an additional step for them with cargo's default test runner.

- Fix doctests for the `nu-pretty-hex` crate
This commit is contained in:
Stefan Holderbach 2022-05-02 11:32:57 +02:00 committed by GitHub
parent 7c9a78d922
commit 1ca3063ac3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 12 deletions

View File

@ -17,9 +17,9 @@ jobs:
- stable - stable
include: include:
- style: all - style: all
flags: '--all-features' flags: "--all-features"
- style: default - style: default
flags: '' flags: ""
exclude: exclude:
- platform: windows-latest - platform: windows-latest
style: default style: default
@ -61,7 +61,6 @@ jobs:
command: clippy command: clippy
args: --workspace ${{ matrix.flags }} -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect args: --workspace ${{ matrix.flags }} -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect
test: test:
strategy: strategy:
fail-fast: false fail-fast: false
@ -72,9 +71,9 @@ jobs:
- stable - stable
include: include:
- style: all - style: all
flags: '--all-features' flags: "--all-features"
- style: default - style: default
flags: '' flags: ""
exclude: exclude:
- platform: windows-latest - platform: windows-latest
style: default style: default
@ -106,6 +105,12 @@ jobs:
command: nextest command: nextest
args: run --all ${{ matrix.flags }} args: run --all ${{ matrix.flags }}
- name: Doctests
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --doc ${{ matrix.flags }}
python-virtualenv: python-virtualenv:
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -8,7 +8,7 @@
//! //!
//! ## Example of `simple_hex()` //! ## Example of `simple_hex()`
//! ``` //! ```
//! use pretty_hex::*; //! use nu_pretty_hex::*;
//! //!
//! let v = vec![222, 173, 190, 239, 202, 254, 32, 24]; //! let v = vec![222, 173, 190, 239, 202, 254, 32, 24];
//! # #[cfg(feature = "alloc")] //! # #[cfg(feature = "alloc")]
@ -23,7 +23,7 @@
//! ``` //! ```
//! ## Example of `pretty_hex()` //! ## Example of `pretty_hex()`
//! ``` //! ```
//! use pretty_hex::*; //! use nu_pretty_hex::*;
//! //!
//! let v = &include_bytes!("../tests/data"); //! let v = &include_bytes!("../tests/data");
//! # #[cfg(feature = "alloc")] //! # #[cfg(feature = "alloc")]
@ -40,7 +40,7 @@
//! ``` //! ```
//! ## Example of `config_hex()` //! ## Example of `config_hex()`
//! ``` //! ```
//! use pretty_hex::*; //! use nu_pretty_hex::*;
//! //!
//! let cfg = HexConfig {title: false, width: 8, group: 0, ..HexConfig::default() }; //! let cfg = HexConfig {title: false, width: 8, group: 0, ..HexConfig::default() };
//! //!