mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-27 16:52:58 +01:00
macros: Add actix-reexport
feature (#218)
This commit is contained in:
parent
89e56cf661
commit
76d956e25c
2
.github/workflows/clippy-fmt.yml
vendored
2
.github/workflows/clippy-fmt.yml
vendored
@ -31,4 +31,4 @@ jobs:
|
|||||||
uses: actions-rs/clippy-check@v1
|
uses: actions-rs/clippy-check@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
args: --all-features --all --tests
|
args: --workspace --tests
|
||||||
|
6
.github/workflows/linux.yml
vendored
6
.github/workflows/linux.yml
vendored
@ -53,20 +53,20 @@ jobs:
|
|||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: check
|
command: check
|
||||||
args: --all --bins --examples --tests
|
args: --workspace --bins --examples --tests
|
||||||
|
|
||||||
- name: tests
|
- name: tests
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
timeout-minutes: 40
|
timeout-minutes: 40
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
args: --all --all-features --no-fail-fast -- --nocapture
|
args: --workspace --exclude=actix-tls --no-fail-fast -- --nocapture
|
||||||
|
|
||||||
- name: Generate coverage file
|
- name: Generate coverage file
|
||||||
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
|
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
|
||||||
run: |
|
run: |
|
||||||
cargo install cargo-tarpaulin
|
cargo install cargo-tarpaulin
|
||||||
cargo tarpaulin --out Xml --workspace --all-features
|
cargo tarpaulin --out Xml --workspace
|
||||||
|
|
||||||
- name: Upload to Codecov
|
- name: Upload to Codecov
|
||||||
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
|
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
|
||||||
|
4
.github/workflows/macos.yml
vendored
4
.github/workflows/macos.yml
vendored
@ -34,10 +34,10 @@ jobs:
|
|||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: check
|
command: check
|
||||||
args: --all --bins --examples --tests
|
args: --workspace --bins --examples --tests
|
||||||
|
|
||||||
- name: tests
|
- name: tests
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
args: --all --all-features --no-fail-fast -- --nocapture
|
args: --workspace --exclude=actix-tls --no-fail-fast -- --nocapture
|
||||||
|
2
.github/workflows/windows-mingw.yml
vendored
2
.github/workflows/windows-mingw.yml
vendored
@ -42,4 +42,4 @@ jobs:
|
|||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: check
|
command: check
|
||||||
args: --all --bins --examples --tests
|
args: --workspace --bins --examples --tests
|
||||||
|
4
.github/workflows/windows.yml
vendored
4
.github/workflows/windows.yml
vendored
@ -60,10 +60,10 @@ jobs:
|
|||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: check
|
command: check
|
||||||
args: --all --bins --examples --tests
|
args: --workspace --bins --examples --tests
|
||||||
|
|
||||||
- name: tests
|
- name: tests
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
args: --all --all-features --no-fail-fast -- --nocapture
|
args: --workspace --exclude=actix-tls --no-fail-fast -- --nocapture
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
# CHANGES
|
# CHANGES
|
||||||
|
|
||||||
|
## 0.1.3 - 2020-12-
|
||||||
|
|
||||||
|
* Add `actix-reexport` feature
|
||||||
|
|
||||||
## 0.1.2 - 2020-05-18
|
## 0.1.2 - 2020-05-18
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-macros"
|
name = "actix-macros"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
description = "Actix runtime macros"
|
description = "Actix runtime macros"
|
||||||
repository = "https://github.com/actix/actix-net"
|
repository = "https://github.com/actix/actix-net"
|
||||||
@ -16,6 +16,9 @@ proc-macro = true
|
|||||||
quote = "1.0.3"
|
quote = "1.0.3"
|
||||||
syn = { version = "^1", features = ["full"] }
|
syn = { version = "^1", features = ["full"] }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
actix-reexport = []
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-rt = "1.0"
|
actix-rt = "1.0"
|
||||||
|
|
||||||
|
@ -33,14 +33,25 @@ pub fn main(_: TokenStream, item: TokenStream) -> TokenStream {
|
|||||||
|
|
||||||
sig.asyncness = None;
|
sig.asyncness = None;
|
||||||
|
|
||||||
(quote! {
|
if cfg!(feature = "actix-reexport") {
|
||||||
#(#attrs)*
|
(quote! {
|
||||||
#vis #sig {
|
#(#attrs)*
|
||||||
actix_rt::System::new(stringify!(#name))
|
#vis #sig {
|
||||||
.block_on(async move { #body })
|
actix::System::new(stringify!(#name))
|
||||||
}
|
.block_on(async move { #body })
|
||||||
})
|
}
|
||||||
.into()
|
})
|
||||||
|
.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.
|
/// Marks async test function to be executed by actix runtime.
|
||||||
|
Loading…
Reference in New Issue
Block a user