diff --git a/.github/workflows/main-checks.yml b/.github/workflows/main-checks.yml index 6c312435f1c..54b4dfdfce0 100644 --- a/.github/workflows/main-checks.yml +++ b/.github/workflows/main-checks.yml @@ -81,12 +81,6 @@ jobs: name: Documentation Tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - path: "./wasm-bindgen" - ref: respect-rustdoc-tmp-paths - repository: hamza1311/wasm-bindgen - - uses: Swatinem/rust-cache@v1 - uses: actions-rs/toolchain@v1 @@ -95,15 +89,10 @@ jobs: override: true profile: minimal - - name: Build wasm-bindgen-test-runner - run: | - cd wasm-bindgen - cargo build -p wasm-bindgen-cli --bin wasm-bindgen-test-runner --release - cp target/release/wasm-bindgen-test-runner ~/.cargo/bin/wasm-bindgen-test-runner + - name: Install wasm-bindgen-test-runner + run: cargo install --git https://github.com/hamza1311/wasm-bindgen --branch respect-rustdoc-tmp-paths - uses: actions/checkout@v2 - with: - path: "./yew" - uses: actions-rs/toolchain@v1 with: @@ -116,19 +105,22 @@ jobs: - uses: nanasess/setup-chromedriver@v1 - name: Run doctest - run: | - cd yew - cargo test --doc --workspace --exclude yew --exclude changelog --exclude website-test --target wasm32-unknown-unknown + uses: actions-rs/cargo@v1 + with: + command: test + args: --doc --workspace --exclude yew --exclude changelog --exclude website-test --target wasm32-unknown-unknown - name: Run website code snippet tests - run: | - cd yew - cargo test -p website-test --target wasm32-unknown-unknown + uses: actions-rs/cargo@v1 + with: + command: test + args: -p website-test --target wasm32-unknown-unknown - name: Run doctest - yew with features - run: | - cd yew - cargo test -p yew --doc --features doc_test --target wasm32-unknown-unknown + uses: actions-rs/cargo@v1 + with: + command: test + args: -p yew --doc --features doc_test --target wasm32-unknown-unknown integration_tests: name: Integration Tests on ${{ matrix.toolchain }} diff --git a/tools/website-test/Cargo.toml b/tools/website-test/Cargo.toml index 65c3568b25e..5f7ada4dba7 100644 --- a/tools/website-test/Cargo.toml +++ b/tools/website-test/Cargo.toml @@ -18,7 +18,7 @@ wasm-bindgen-futures = "0.4" weblog = "0.3.0" yew = { path = "../../packages/yew/", features = ["ssr", "csr"] } yew-router = { path = "../../packages/yew-router/" } -#tokio = { version = "1.15.0", features = ["full"] } +tokio = { version = "1.15.0", features = ["rt", "macros"] } [dev-dependencies.web-sys] version = "0.3" diff --git a/website/docs/advanced-topics/server-side-rendering.md b/website/docs/advanced-topics/server-side-rendering.md index 438a3df36c0..2e38b6f4a89 100644 --- a/website/docs/advanced-topics/server-side-rendering.md +++ b/website/docs/advanced-topics/server-side-rendering.md @@ -39,7 +39,11 @@ fn App() -> Html { html! {
{"Hello, World!"}
} } +// we use `flavor = "current_thread"` so this snippet can be tested in CI, +// where tests are run in a WASM environment. You likely want to use +// the (default) `multi_thread` favor as: // #[tokio::main] +#[tokio::main(flavor = "current_thread")] async fn no_main() { let renderer = ServerRenderer::::new();