From a807199d3e092896a396bc8e307536998c185f69 Mon Sep 17 00:00:00 2001 From: Clay McLeod <3411613+claymcleod@users.noreply.github.com> Date: Thu, 5 Sep 2024 00:16:31 -0500 Subject: [PATCH] ci: adds continuous integration workflow (#4) --- .github/workflows/CI.yml | 52 ++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 3 +-- src/lib.rs | 19 --------------- 3 files changed, 53 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..c4bfef6 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,52 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +jobs: + format: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Update Rust + run: rustup update nightly && rustup default nightly + - name: Install rustfmt + run: rustup component add rustfmt + - run: cargo fmt -- --check + + lint: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Update Rust + run: rustup update stable && rustup default stable + - name: Install clippy + run: rustup component add clippy + - run: cargo clippy --all-features -- --deny warnings + + test: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Update Rust + run: rustup update stable && rustup default stable + - run: cargo test --all-features + + test-examples: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Update Rust + run: rustup update stable && rustup default stable + - run: cargo test --all-features --examples + + docs: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Update Rust + run: rustup update stable && rustup default stable + - run: cargo doc diff --git a/Cargo.toml b/Cargo.toml index 25c5430..8708d4b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,6 @@ tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } url = "2.5.2" [lints.rust] -broken_intra_doc_links = "warn" missing_docs = "warn" nonstandard-style = "warn" rust-2018-idioms = "warn" @@ -27,7 +26,7 @@ rust-2021-compatibility = "warn" rust-2024-compatibility = "warn" [lints.rustdoc] -missing_doc_code_examples = "warn" +broken_intra_doc_links = "warn" [lints.clippy] missing_docs_in_private_items = "warn" diff --git a/src/lib.rs b/src/lib.rs index c96b2cd..2b8b64b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,25 +17,6 @@ pub type BoxedError = Box; /// `Logger`) if that is the construct struct wrapped. /// * `variant` is the name of the variant in the enum that wraps the concrete /// struct (e.g., `Logger` if the variant is `Self::Logger`). -/// -/// A simple example: -/// -/// ```rust -/// /// Services that can be registered within the engine. -/// #[derive(Debug)] -/// pub enum Service { -/// /// A logging service. -/// Logger(Logger), -/// -/// /// A task runner service. -/// Runner(Runner), -/// } -/// -/// impl Service { -/// as_into_unwrap!(logger, Logger, Logger); -/// as_into_unwrap!(runner, Runner, Runner); -/// } -/// ``` #[macro_export] macro_rules! as_into_unwrap { ($suffix:ident, $inner:ty, $variant:ident) => {