-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* clippy in tests * add pull request workflow * fix formatting * add names to steps * fix clippy * update * avoid mutable * use wasm target * install it too * except there * let's give chrome a spin * clippy has some more to say * only run specific tests * fix tests on chrome * add cache * rename benchmark for consistency * re-enable geckodriver * clean up old files * remove all mentions of Travis * check all examples * let's try with a bigger timeout * test both browsers at the same time * chrome really doesn't like me * finish up * run for pushes to master * improve caching * fix order in workspace members * clippy use --all-targets * rename workflow file * Apply suggestions from code review Co-authored-by: Justin Starry <justin.m.starry@gmail.com> * use stable toolchain for lints * run lints on nightly too * add doctest for yew-stdweb * allow failure for nightly clippy steps * let's try it on the job level again * always run all lint steps * only run lints on stable toolchain * use 'no_run' instead of 'ignore' Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
- Loading branch information
Showing
24 changed files
with
274 additions
and
152 deletions.
There are no files selected for viewing
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
File renamed without changes.
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,225 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
lint: | ||
name: Format & Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
profile: minimal | ||
components: rustfmt, clippy | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
yew-stdweb/target | ||
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }} | ||
restore-keys: | | ||
cargo-${{ runner.os }}- | ||
- name: Run fmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
- name: Run clippy | ||
if: always() | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all-targets -- -D warnings | ||
|
||
- name: Run clippy - yew with all features | ||
if: always() | ||
run: | | ||
cd yew | ||
cargo clippy --all-targets --features "cbor msgpack toml yaml" -- -D warnings | ||
- name: Run clippy - yew-stdweb with all features | ||
if: always() | ||
run: | | ||
cd yew-stdweb | ||
cargo clippy --all-targets --features "cbor msgpack toml yaml" -- -D warnings | ||
check_examples: | ||
name: Check Examples | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
profile: minimal | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }} | ||
restore-keys: | | ||
cargo-${{ runner.os }}- | ||
- name: Run check | ||
run: | | ||
cd examples | ||
cargo check --all-targets | ||
doc_tests: | ||
name: Documentation Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: wasm32-unknown-unknown | ||
override: true | ||
profile: minimal | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }} | ||
restore-keys: | | ||
cargo-${{ runner.os }}- | ||
- name: Run doctest | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --doc | ||
|
||
- name: Run doctest - yew with features | ||
run: | | ||
cd yew | ||
cargo test --doc --features "doc_test wasm_test yaml msgpack cbor toml" | ||
- name: Run doctest - yew-stdweb with features | ||
run: | | ||
# Sadly we can't run the tests on yew-stdweb as the snippets use `yew`, not `yew_stdweb` so the imports wouldn't work. | ||
# To fix this we just run them on yew but with yew-stdweb's default features enabled. | ||
cd yew | ||
cargo test --doc \ | ||
--no-default-features --features "services agent std_web" \ | ||
--features "doc_test wasm_test yaml msgpack cbor toml" | ||
integration_tests: | ||
name: Integration Tests on ${{ matrix.toolchain }} | ||
runs-on: ubuntu-latest | ||
services: | ||
httpbin: | ||
image: kennethreitz/httpbin@sha256:599fe5e5073102dbb0ee3dbb65f049dab44fa9fc251f6835c9990f8fb196a72b | ||
ports: | ||
- 8080:80 | ||
|
||
strategy: | ||
matrix: | ||
toolchain: | ||
- 1.45.0 # MSRV | ||
- stable | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
target: wasm32-unknown-unknown | ||
override: true | ||
profile: minimal | ||
|
||
- name: Install wasm-pack | ||
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
yew-stdweb/target | ||
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }} | ||
restore-keys: | | ||
cargo-${{ runner.os }}- | ||
# FIXME: Only needed because of <https://github.com/rustwasm/wasm-bindgen/issues/2261> | ||
- name: Install geckodriver | ||
run: | | ||
cd ~ | ||
mkdir geckodriver | ||
curl --retry 5 -LO https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz | ||
tar -xzf geckodriver-*-linux64.tar.gz -C geckodriver | ||
echo "::add-path::$HOME/geckodriver" | ||
- name: Run tests - yew | ||
env: | ||
HTTPBIN_URL: "http://localhost:8080" | ||
run: | | ||
cd yew | ||
wasm-pack test --chrome --firefox --headless -- --features "wasm_test httpbin_test" | ||
- name: Run tests - yew-stdweb | ||
env: | ||
HTTPBIN_URL: "http://localhost:8080" | ||
run: | | ||
cd yew-stdweb | ||
# FIXME: Chrome really doesn't seem to like yew-stdweb | ||
wasm-pack test --firefox --headless -- --features "wasm_test httpbin_test" | ||
- name: Run tests - yew-functional | ||
run: | | ||
cd yew-functional | ||
wasm-pack test --chrome --firefox --headless | ||
unit_tests: | ||
name: Unit Tests on ${{ matrix.toolchain }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
toolchain: | ||
- 1.45.0 # MSRV | ||
- stable | ||
- nightly | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
override: true | ||
profile: minimal | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }} | ||
restore-keys: | | ||
cargo-${{ runner.os }}- | ||
- name: Run tests | ||
run: | | ||
packages=("yew-components" "yew-functional" "yew-macro" "yew-router" "yew-router-macro" "yew-router-route-parser" "yewtil") | ||
for package in "${packages[@]}"; do | ||
(cd "$package" && cargo test) | ||
done |
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 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
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.