diff --git a/.cargo/config b/.cargo/config index bba9c7fbd5b..c730d179d49 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,2 +1,5 @@ [target.'cfg(target_arch = "wasm32")'] runner = 'wasm-bindgen-test-runner' + +[unstable] +doctest-xcompile = true diff --git a/.github/workflows/main-checks.yml b/.github/workflows/main-checks.yml index db27c709143..9e412e4f3f8 100644 --- a/.github/workflows/main-checks.yml +++ b/.github/workflows/main-checks.yml @@ -49,36 +49,65 @@ jobs: command: clippy args: --all-targets --release -- -D warnings + spell_tests: + name: Spell Test with aspell + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Check spelling + run: | + sudo apt-get install aspell + ci/spellcheck.sh list doc_tests: - name: Documentation Tests runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - toolchain: stable + target: "x86_64-unknown-linux-gnu" + - toolchain: nightly + target: "x86_64-unknown-linux-gnu" + - toolchain: nightly + target: "wasm32-unknown-unknown" + + name: Test doc code snippets on ${{ matrix.toolchain }} with ${{ matrix.target }} + env: + CARGO_BUILD_TARGET: ${{ matrix.target }} steps: - uses: actions/checkout@v2 + + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/toolchain@v1 with: - toolchain: stable - target: wasm32-unknown-unknown + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.target }} override: true profile: minimal - - uses: Swatinem/rust-cache@v1 - - - name: Check spelling + - name: Install wasm-bindgen-cli run: | - sudo apt-get install aspell - ci/spellcheck.sh list + wget https://github.com/rustwasm/wasm-bindgen/releases/download/0.2.78/wasm-bindgen-0.2.78-x86_64-unknown-linux-musl.tar.gz + tar -xzf wasm-bindgen-0.2.78-x86_64-unknown-linux-musl.tar.gz + mv wasm-bindgen-0.2.78-x86_64-unknown-linux-musl/wasm-bindgen ~/.cargo/bin/ + - name: Setup geckodriver + uses: browser-actions/setup-geckodriver@latest - name: Run doctest uses: actions-rs/cargo@v1 + if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} with: command: test - args: --doc + args: --doc --workspace --exclude yew --exclude website-test - name: Run website code snippet tests uses: actions-rs/cargo@v1 with: + toolchain: ${{ matrix.toolchain }} command: test args: -p website-test @@ -88,8 +117,6 @@ jobs: command: test args: --doc --features doc_test --features wasm_test - - integration_tests: name: Integration Tests on ${{ matrix.toolchain }} runs-on: ubuntu-latest diff --git a/tools/website-test/Cargo.toml b/tools/website-test/Cargo.toml index 43d17d80a25..4684025ad4c 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"] } yew-router = { path = "../../packages/yew-router/" } -tokio = { version = "1.15.0", features = ["full"] } +#tokio = { version = "1.15.0", features = ["full"] } [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 d69dda3cbdc..436a391b508 100644 --- a/website/docs/advanced-topics/server-side-rendering.md +++ b/website/docs/advanced-topics/server-side-rendering.md @@ -30,7 +30,7 @@ To render Yew components at the server-side, you can create a renderer with `ServerRenderer::::new()` and call `renderer.render().await` to render `` into a `String`. -```rust +```rust ,ignore use yew::prelude::*; use yew::ServerRenderer;