mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
245 lines
5.9 KiB
YAML
245 lines
5.9 KiB
YAML
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
|
|
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
|
|
|
|
lint-release:
|
|
name: Clippy on release profile
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
profile: minimal
|
|
components: clippy
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: cargo-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.toml') }}
|
|
restore-keys: |
|
|
cargo-${{ runner.os }}-${{ github.job }}-
|
|
|
|
- name: Run clippy
|
|
if: always()
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: clippy
|
|
args: --all-targets --release -- -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
|
|
# Using 20.04 because 18.04 (latest) only has aspell 0.60.7 and we need 0.60.8
|
|
runs-on: ubuntu-20.04
|
|
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: Check spelling
|
|
run: |
|
|
sudo apt-get install aspell
|
|
ci/spellcheck.sh list
|
|
|
|
- name: Run doctest
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --doc
|
|
|
|
- name: Run doctest - yew with features
|
|
run: |
|
|
cd packages/yew
|
|
cargo test --doc --features "doc_test wasm_test"
|
|
|
|
- name: Run website code snippet tests
|
|
run: |
|
|
cd tools/website-test
|
|
cargo test
|
|
|
|
integration_tests:
|
|
name: Integration Tests on ${{ matrix.toolchain }}
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
toolchain:
|
|
- 1.49.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
|
|
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}
|
|
restore-keys: |
|
|
cargo-${{ runner.os }}-
|
|
|
|
- name: Run tests - yew
|
|
run: |
|
|
cd packages/yew
|
|
wasm-pack test --chrome --firefox --headless -- --features "wasm_test"
|
|
|
|
- name: Run tests - yew-router
|
|
run: |
|
|
cd packages/yew-router
|
|
wasm-pack test --chrome --firefox --headless
|
|
|
|
unit_tests:
|
|
name: Unit Tests on ${{ matrix.toolchain }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
toolchain:
|
|
- 1.51.0 # min version with const generics
|
|
- 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
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --all-targets --workspace --exclude yew
|
|
|
|
test-lints:
|
|
name: Test lints on nightly
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
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: |
|
|
cd packages/yew-macro
|
|
cargo +nightly test test_html_lints --features lints
|