Run CI checks & tests on Windows and Mac (#206)

* Run CI checks & tests on Windows and Mac

* Fix uds windows compile

Co-authored-by: Lucio Franco <[email protected]>
This commit is contained in:
Johan Andersson
2020-01-11 14:16:54 -08:00
committed by Lucio Franco
co-authored by Lucio Franco
parent 6673f91f1f
commit 3be8bc1668
3 changed files with 63 additions and 43 deletions
+8 -1
View File
@@ -1,4 +1,4 @@
#[cfg(unix)]
#![cfg_attr(not(unix), allow(unused_imports))]
pub mod hello_world {
tonic::include_proto!("helloworld");
@@ -7,10 +7,12 @@ pub mod hello_world {
use hello_world::{greeter_client::GreeterClient, HelloRequest};
use http::Uri;
use std::convert::TryFrom;
#[cfg(unix)]
use tokio::net::UnixStream;
use tonic::transport::Endpoint;
use tower::service_fn;
#[cfg(unix)]
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// We will ignore this uri because uds do not use it
@@ -37,3 +39,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}
#[cfg(not(unix))]
fn main() {
panic!("The `uds` example only works on unix systems!");
}