From 3c9991cdc90eecfd71da7dd021e7f5b1816b028d Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 31 Jan 2018 15:10:39 +0100 Subject: [PATCH] Test the emscripten code on circle-ci (#119) * Test the emscripten code on circle-ci * Fix missing from workflow --- .circleci/config.yml | 19 ++++++++++++++++++- Cargo.toml | 10 +++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ba82453..39a60b67 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,6 +5,7 @@ workflows: build: jobs: - test + - test-emscripten - integration_test jobs: @@ -33,10 +34,26 @@ jobs: name: Run tests, inside a docker image command: docker run --rm -v "/cache/cargo/registry:/usr/local/cargo/registry" -v "/cache/target:/app/target" -it rust-libp2p cargo test - save_cache: - key: docker-cache + key: test-cache paths: - "/cache" + test-emscripten: + docker: + - image: tomaka/rustc-emscripten + steps: + - checkout + - restore_cache: + key: test-emscripten-cache + - run: + name: Build for emscripten + command: cargo build --target asmjs-unknown-emscripten --package libp2p-websocket # TODO: build all? + - save_cache: + key: test-emscripten-cache + paths: + - "~/.cargo" + - "./target" + integration_test: docker: - image: rust diff --git a/Cargo.toml b/Cargo.toml index 059be1bd..f0b93193 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,8 +21,12 @@ members = [ "example", ] -[replace] +[patch.crates-io] # TODO: Update ring and solve conflicts -"ring:0.12.1" = { git = "https://github.com/briansmith/ring", rev = "3a14ef619559f7d4b69e2286d49c833409eef34a" } +"ring" = { git = "https://github.com/briansmith/ring", rev = "3a14ef619559f7d4b69e2286d49c833409eef34a" } # Using a local improved version of multiaddr for now -"multiaddr:0.2.0" = { path = "./rust-multiaddr" } +# TODO: remove once merged upstream +"multiaddr" = { path = "./rust-multiaddr" } +# Using a version of rust-multihash that compiles on emscripten +# TODO: remove once merged upstream +"multihash" = { git = "https://github.com/tomaka/rust-multihash", branch = "emscripten-hack" }