Skip to content

Commit

Permalink
don't be dumb
Browse files Browse the repository at this point in the history
  • Loading branch information
ranile committed May 1, 2022
1 parent 4a1bf47 commit b65cb91
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
36 changes: 14 additions & 22 deletions .github/workflows/main-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion tools/website-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions website/docs/advanced-topics/server-side-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ fn App() -> Html {
html! {<div>{"Hello, World!"}</div>}
}

// 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::<App>::new();

Expand Down

0 comments on commit b65cb91

Please sign in to comment.