diff --git a/.github/workflows/clippy-fmt.yml b/.github/workflows/clippy-fmt.yml index 85a42522..12343dd4 100644 --- a/.github/workflows/clippy-fmt.yml +++ b/.github/workflows/clippy-fmt.yml @@ -31,4 +31,4 @@ jobs: uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features --all --tests + args: --workspace --tests diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 3e77e990..23efaa8a 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -53,20 +53,20 @@ jobs: uses: actions-rs/cargo@v1 with: command: check - args: --all --bins --examples --tests + args: --workspace --bins --examples --tests - name: tests uses: actions-rs/cargo@v1 timeout-minutes: 40 with: command: test - args: --all --all-features --no-fail-fast -- --nocapture + args: --workspace --exclude=actix-tls --no-fail-fast -- --nocapture - name: Generate coverage file if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request') run: | cargo install cargo-tarpaulin - cargo tarpaulin --out Xml --workspace --all-features + cargo tarpaulin --out Xml --workspace - name: Upload to Codecov if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request') diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 98788274..b2555bd3 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -34,10 +34,10 @@ jobs: uses: actions-rs/cargo@v1 with: command: check - args: --all --bins --examples --tests + args: --workspace --bins --examples --tests - name: tests uses: actions-rs/cargo@v1 with: command: test - args: --all --all-features --no-fail-fast -- --nocapture + args: --workspace --exclude=actix-tls --no-fail-fast -- --nocapture diff --git a/.github/workflows/windows-mingw.yml b/.github/workflows/windows-mingw.yml index b83d251b..1fd5fc59 100644 --- a/.github/workflows/windows-mingw.yml +++ b/.github/workflows/windows-mingw.yml @@ -42,4 +42,4 @@ jobs: uses: actions-rs/cargo@v1 with: command: check - args: --all --bins --examples --tests + args: --workspace --bins --examples --tests diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a319fd65..b2b57989 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -60,10 +60,10 @@ jobs: uses: actions-rs/cargo@v1 with: command: check - args: --all --bins --examples --tests + args: --workspace --bins --examples --tests - name: tests uses: actions-rs/cargo@v1 with: command: test - args: --all --all-features --no-fail-fast -- --nocapture + args: --workspace --exclude=actix-tls --no-fail-fast -- --nocapture diff --git a/actix-macros/CHANGES.md b/actix-macros/CHANGES.md index 7b89882e..1f951981 100644 --- a/actix-macros/CHANGES.md +++ b/actix-macros/CHANGES.md @@ -1,5 +1,9 @@ # CHANGES +## 0.1.3 - 2020-12- + +* Add `actix-reexport` feature + ## 0.1.2 - 2020-05-18 ### Changed diff --git a/actix-macros/Cargo.toml b/actix-macros/Cargo.toml index 3bef8ea2..1181ace5 100644 --- a/actix-macros/Cargo.toml +++ b/actix-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-macros" -version = "0.1.2" +version = "0.1.3" authors = ["Nikolay Kim "] description = "Actix runtime macros" repository = "https://github.com/actix/actix-net" @@ -16,6 +16,9 @@ proc-macro = true quote = "1.0.3" syn = { version = "^1", features = ["full"] } +[features] +actix-reexport = [] + [dev-dependencies] actix-rt = "1.0" diff --git a/actix-macros/src/lib.rs b/actix-macros/src/lib.rs index 04c374a5..e4baa15b 100644 --- a/actix-macros/src/lib.rs +++ b/actix-macros/src/lib.rs @@ -33,14 +33,25 @@ pub fn main(_: TokenStream, item: TokenStream) -> TokenStream { sig.asyncness = None; - (quote! { - #(#attrs)* - #vis #sig { - actix_rt::System::new(stringify!(#name)) - .block_on(async move { #body }) - } - }) - .into() + if cfg!(feature = "actix-reexport") { + (quote! { + #(#attrs)* + #vis #sig { + actix::System::new(stringify!(#name)) + .block_on(async move { #body }) + } + }) + .into() + } else { + (quote! { + #(#attrs)* + #vis #sig { + actix_rt::System::new(stringify!(#name)) + .block_on(async move { #body }) + } + }) + .into() + } } /// Marks async test function to be executed by actix runtime.