forked from yewstack/yew
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into immutable
- Loading branch information
Showing
164 changed files
with
4,049 additions
and
1,777 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[target.'cfg(target_arch = "wasm32")'] | ||
runner = 'wasm-bindgen-test-runner' | ||
|
||
[unstable] | ||
doctest-xcompile = true | ||
# [unstable] must be the last section -- ci/write-optimisation-flags.sh relies on it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ jobs: | |
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all-targets -- -D warnings | ||
args: --all-targets --all-features -- -D warnings | ||
|
||
- name: Lint feature soundness | ||
run: | | ||
|
@@ -51,12 +51,11 @@ jobs: | |
|
||
- uses: Swatinem/rust-cache@v1 | ||
|
||
|
||
- name: Run clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all-targets --release -- -D warnings | ||
args: --all-targets --all-features --release -- -D warnings | ||
|
||
- name: Lint feature soundness | ||
run: | | ||
|
@@ -67,46 +66,60 @@ jobs: | |
cargo clippy --release --all-features --all-targets -- --deny=warnings | ||
working-directory: packages/yew | ||
|
||
spell_check: | ||
name: spellcheck | ||
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 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: Swatinem/rust-cache@v1 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: wasm32-unknown-unknown | ||
override: true | ||
profile: minimal | ||
|
||
- uses: Swatinem/rust-cache@v1 | ||
- name: Install wasm-bindgen-test-runner | ||
run: cargo install --git https://github.com/hamza1311/wasm-bindgen --branch respect-rustdoc-tmp-paths wasm-bindgen-cli | ||
|
||
- name: Check spelling | ||
run: | | ||
sudo apt-get install aspell | ||
ci/spellcheck.sh list | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
target: wasm32-unknown-unknown | ||
override: true | ||
profile: minimal | ||
|
||
- uses: browser-actions/setup-geckodriver@latest | ||
- uses: nanasess/setup-chromedriver@v1 | ||
|
||
- name: Run doctest | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --doc | ||
args: --doc --workspace --exclude yew --exclude changelog --exclude website-test --exclude ssr_router --exclude simple_ssr --target wasm32-unknown-unknown | ||
|
||
- name: Run website code snippet tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: -p website-test | ||
args: -p website-test --target wasm32-unknown-unknown | ||
|
||
- name: Run doctest - yew with features | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --doc --features doc_test --features wasm_test | ||
|
||
|
||
args: -p yew --doc --all-features --target wasm32-unknown-unknown | ||
|
||
integration_tests: | ||
name: Integration Tests on ${{ matrix.toolchain }} | ||
|
@@ -128,23 +141,31 @@ jobs: | |
override: true | ||
profile: minimal | ||
|
||
- uses: jetli/[email protected] | ||
with: | ||
version: "latest" | ||
- uses: browser-actions/setup-geckodriver@latest | ||
- uses: nanasess/setup-chromedriver@v1 | ||
|
||
- uses: Swatinem/rust-cache@v1 | ||
|
||
- name: Install wasm-bindgen-cli | ||
shell: bash | ||
run: | | ||
if [ ! -f "Cargo.lock" ]; then | ||
cargo fetch | ||
fi | ||
VERSION=`cargo pkgid --frozen wasm-bindgen | cut -d ":" -f 3` | ||
cargo install --version $VERSION wasm-bindgen-cli | ||
- name: Run tests - yew | ||
run: | | ||
cd packages/yew | ||
wasm-pack test --chrome --firefox --headless -- --features "wasm_test" | ||
CHROMEDRIVER=$(which chromedriver) cargo test --features csr,hydration,ssr --target wasm32-unknown-unknown | ||
GECKODRIVER=$(which geckodriver) cargo test --features csr,hydration,ssr --target wasm32-unknown-unknown | ||
- name: Run tests - yew-router | ||
run: | | ||
cd packages/yew-router | ||
wasm-pack test --chrome --firefox --headless | ||
CHROMEDRIVER=$(which chromedriver) cargo test --target wasm32-unknown-unknown | ||
GECKODRIVER=$(which geckodriver) cargo test --target wasm32-unknown-unknown | ||
unit_tests: | ||
name: Unit Tests on ${{ matrix.toolchain }} | ||
|
@@ -170,13 +191,17 @@ jobs: | |
|
||
- uses: Swatinem/rust-cache@v1 | ||
|
||
- name: Run tests | ||
- name: Run native tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all-targets --workspace --exclude yew --exclude website-test | ||
|
||
args: --all-targets --workspace --exclude yew --exclude website-test --exclude ssr_router --exclude simple_ssr | ||
|
||
- name: Run native tests for yew | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: -p yew --features "csr,ssr,hydration,tokio" | ||
|
||
test-lints: | ||
name: Test lints on nightly | ||
|
@@ -192,7 +217,6 @@ jobs: | |
|
||
- uses: Swatinem/rust-cache@v1 | ||
|
||
|
||
- name: Run tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,62 +12,29 @@ jobs: | |
env: | ||
# leave empty for / | ||
PUBLIC_URL_PREFIX: "" | ||
RUSTUP_TOOLCHAIN: nightly | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
toolchain: nightly | ||
target: wasm32-unknown-unknown | ||
components: rust-src | ||
override: true | ||
profile: minimal | ||
|
||
- name: Write optimisation flags | ||
run: ./ci/write-optimisation-flags.sh | ||
|
||
- uses: Swatinem/rust-cache@v1 | ||
|
||
- uses: jetli/[email protected] | ||
with: | ||
# Optional version of trunk to install(eg. 'v0.8.1', 'latest') | ||
version: 'latest' | ||
|
||
|
||
|
||
- name: Build examples | ||
run: | | ||
output="$(pwd)/dist" | ||
mkdir "$output" | ||
for path in examples/*; do | ||
if [[ ! -d $path ]]; then | ||
continue | ||
fi | ||
example=$(basename "$path") | ||
# multi_thread doesn't work yet. See <https://github.com/thedodd/trunk/issues/40>. | ||
if [[ "$example" == "agents" ]]; then | ||
continue | ||
fi | ||
# web_worker_fib does not compile with trunk. See <https://github.com/thedodd/trunk/issues/46>. | ||
if [[ "$example" == "web_worker_fib" ]]; then | ||
continue | ||
fi | ||
# ssr does not need trunk | ||
if [[ "$example" == "simple_ssr" ]]; then | ||
continue | ||
fi | ||
echo "building: $example" | ||
( | ||
cd "$path" | ||
dist_dir="$output/$example" | ||
trunk build --release --dist "$dist_dir" --public-url "$PUBLIC_URL_PREFIX/$example" | ||
) | ||
done | ||
run: ./ci/build-examples.sh | ||
|
||
- name: Deploy to Firebase | ||
uses: siku2/action-hosting-deploy@v0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.