diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0858e691..86ef80c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,17 +38,10 @@ jobs: - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly + toolchain: stable targets: "wasm32-unknown-unknown" - uses: Swatinem/rust-cache@v1 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: 14.21 - - - name: Compile and test wasm - run: | - cd wasm_test - cargo +nightly build --target wasm32-unknown-unknown - node test.js + - name: wasm-check + run: + cargo check --target wasm32-unknown-unknown diff --git a/Cargo.lock b/Cargo.lock index 2695ed41..9753b355 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1223,13 +1223,6 @@ dependencies = [ "serde", ] -[[package]] -name = "lyon_wasm_test" -version = "0.11.0" -dependencies = [ - "lyon", -] - [[package]] name = "malloc_buf" version = "0.0.6" diff --git a/Cargo.toml b/Cargo.toml index 9a45405c..775648d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,6 @@ members = [ "crates/geom", "crates/extra", "cli", - "wasm_test", "examples/wgpu", "examples/wgpu_svg", "bench/tess", diff --git a/wasm_test/Cargo.toml b/wasm_test/Cargo.toml deleted file mode 100644 index 050b7c6f..00000000 --- a/wasm_test/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "lyon_wasm_test" -version = "0.11.0" -authors = ["Nicolas Silva "] -repository = "https://github.com/nical/lyon" -keywords = ["2d", "graphics", "tessellation", "svg", "wasm"] -license = "MIT OR Apache-2.0" -workspace = ".." - -[lib] -name = "wasm_test" -crate-type = ["cdylib"] - -[dependencies] -lyon = { path = "../crates/lyon", features = ["extra"] } diff --git a/wasm_test/src/lib.rs b/wasm_test/src/lib.rs deleted file mode 100644 index 09c3260e..00000000 --- a/wasm_test/src/lib.rs +++ /dev/null @@ -1,29 +0,0 @@ -extern crate lyon; - -use lyon::extra::rust_logo::build_logo_path; -use lyon::math::Point; -use lyon::path::Path; -use lyon::tessellation::geometry_builder::{simple_builder, VertexBuffers}; -use lyon::tessellation::FillOptions; -use lyon::tessellation::FillTessellator; - -#[no_mangle] -pub extern "C" fn run_tests() { - test_logo(); -} - -fn test_logo() { - let mut path = Path::builder().with_svg(); - build_logo_path(&mut path); - let path = path.build(); - - let mut buffers: VertexBuffers = VertexBuffers::new(); - let mut tess = FillTessellator::new(); - - tess.tessellate( - &path, - &FillOptions::tolerance(0.05), - &mut simple_builder(&mut buffers), - ) - .unwrap(); -} diff --git a/wasm_test/test.js b/wasm_test/test.js deleted file mode 100644 index 4c2ff743..00000000 --- a/wasm_test/test.js +++ /dev/null @@ -1,14 +0,0 @@ - -var fs = require('fs'); - -var wasm_bin = fs.readFileSync('../target/wasm32-unknown-unknown/debug/wasm_test.wasm'); - -WebAssembly.instantiate(wasm_bin, { env: { Math_hypot: Math.hypot } }).then(obj => { - //console.log(Object.keys(obj.instance.exports)); - console.log(" -- run tests..."); - obj.instance.exports.run_tests(); - console.log(" -- ...done!"); -}).catch(err => { - console.error(err); - process.exit(1); -});