mirror of https://github.com/yewstack/yew
Fix Dependabot and GitHub Actions (#3111)
This commit is contained in:
parent
48daf52986
commit
08f4fd3032
|
@ -1,5 +1,7 @@
|
|||
[target.'cfg(target_arch = "wasm32")']
|
||||
runner = 'wasm-bindgen-test-runner'
|
||||
|
||||
# This section needs to be last.
|
||||
# GitHub Actions modifies this section.
|
||||
[unstable]
|
||||
doctest-xcompile = true
|
||||
|
|
|
@ -6,20 +6,6 @@ updates:
|
|||
interval: "weekly"
|
||||
day: "friday"
|
||||
open-pull-requests-limit: 5
|
||||
|
||||
- package-ecosystem: "cargo"
|
||||
directory: "/examples"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "friday"
|
||||
open-pull-requests-limit: 5
|
||||
|
||||
- package-ecosystem: "cargo"
|
||||
directory: "/tools"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "friday"
|
||||
open-pull-requests-limit: 5
|
||||
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/website"
|
||||
|
|
|
@ -22,7 +22,7 @@ jobs:
|
|||
- name: Checkout master
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'yewstack/yew'
|
||||
repository: "yewstack/yew"
|
||||
ref: master
|
||||
path: yew-master
|
||||
|
||||
|
@ -50,12 +50,12 @@ jobs:
|
|||
key: pr
|
||||
|
||||
- name: Run pull request benchmark
|
||||
run: cargo run --profile=bench --bin benchmark-ssr -- --output-path ./output.json
|
||||
working-directory: current-pr/tools
|
||||
run: cargo run --profile=bench -- --output-path ../output.json
|
||||
working-directory: current-pr/tools/benchmark-ssr
|
||||
|
||||
- name: Run master benchmark
|
||||
run: cargo run --profile=bench --bin benchmark-ssr -- --output-path ./output.json
|
||||
working-directory: yew-master/tools
|
||||
run: cargo run --profile=bench -- --output-path ../output.json
|
||||
working-directory: yew-master/tools/benchmark-ssr
|
||||
|
||||
- name: Write Pull Request ID
|
||||
run: |
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
name: Clippy
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/clippy.yml"
|
||||
- "tools/**/*"
|
||||
- "examples/**/*"
|
||||
- "packages/**/*"
|
||||
- "Cargo.toml"
|
||||
- "Cargo.lock"
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
feature-soundness:
|
||||
name: Feature Soundness
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
profile:
|
||||
- dev
|
||||
- release
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: stable
|
||||
components: clippy
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Lint feature soundness
|
||||
if: matrix.profile == 'dev'
|
||||
run: bash ../../ci/feature-soundness.sh
|
||||
working-directory: packages/yew
|
||||
|
||||
- name: Lint feature soundness
|
||||
if: matrix.profile == 'release'
|
||||
run: bash ../../ci/feature-soundness-release.sh
|
||||
working-directory: packages/yew
|
||||
|
||||
- name: Run release clippy
|
||||
if: matrix.profile == 'release'
|
||||
run: |
|
||||
ls packages | xargs -I {} \
|
||||
cargo clippy \
|
||||
-p {} \
|
||||
--all-targets \
|
||||
--all-features \
|
||||
--workspace \
|
||||
-- -D warnings
|
||||
|
||||
clippy:
|
||||
name: Clippy Workspace
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
toolchain:
|
||||
- stable
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{ matrix.toolchain }}
|
||||
components: clippy
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Run clippy
|
||||
run: |
|
||||
cargo clippy \
|
||||
--all-targets \
|
||||
--all-features \
|
||||
--workspace \
|
||||
-- -D warnings
|
|
@ -3,47 +3,15 @@ name: Main Checks
|
|||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/main-checks.yml'
|
||||
- 'ci/**'
|
||||
- 'packages/**/*'
|
||||
- 'Cargo.toml'
|
||||
- ".github/workflows/main-checks.yml"
|
||||
- "ci/**"
|
||||
- "packages/**/*"
|
||||
- "Cargo.toml"
|
||||
- "Cargo.lock"
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
clippy:
|
||||
name: Clippy
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
profile:
|
||||
- dev
|
||||
- release
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: stable
|
||||
components: clippy
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Run clippy
|
||||
run: cargo clippy --all-targets --all-features --profile ${{ matrix.profile }} -- -D warnings
|
||||
|
||||
- name: Lint feature soundness
|
||||
if: matrix.profile == 'dev'
|
||||
run: bash ../../ci/feature-soundness.sh
|
||||
working-directory: packages/yew
|
||||
|
||||
- name: Lint feature soundness
|
||||
if: matrix.profile == 'release'
|
||||
run: bash ../../ci/feature-soundness-release.sh
|
||||
working-directory: packages/yew
|
||||
|
||||
spell_check:
|
||||
name: spellcheck
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -61,11 +29,6 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Setup toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
# for wasm-bindgen-cli, always use stable rust
|
||||
- name: Setup toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
|
@ -83,17 +46,18 @@ jobs:
|
|||
targets: wasm32-unknown-unknown
|
||||
|
||||
- uses: browser-actions/setup-geckodriver@latest
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: nanasess/setup-chromedriver@v1
|
||||
|
||||
- name: Run doctest
|
||||
run: cargo test --doc --workspace --exclude yew --target wasm32-unknown-unknown
|
||||
|
||||
- name: Run website code snippet tests
|
||||
run: cargo test -p website-test --target wasm32-unknown-unknown
|
||||
working-directory: tools
|
||||
|
||||
- name: Run doctest - yew with features
|
||||
run: cargo test -p yew --doc --all-features --target wasm32-unknown-unknown
|
||||
run: |
|
||||
ls packages | xargs -I {} \
|
||||
cargo test \
|
||||
-p {} \
|
||||
--doc \
|
||||
--all-features \
|
||||
--target wasm32-unknown-unknown
|
||||
|
||||
integration_tests:
|
||||
name: Integration Tests on ${{ matrix.toolchain }}
|
||||
|
@ -128,6 +92,9 @@ jobs:
|
|||
targets: wasm32-unknown-unknown
|
||||
|
||||
- uses: browser-actions/setup-geckodriver@latest
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: nanasess/setup-chromedriver@v1
|
||||
|
||||
- name: Run tests - yew
|
||||
|
@ -170,7 +137,7 @@ jobs:
|
|||
# workaround for lack of ternary operator
|
||||
# see https://github.com/orgs/community/discussions/25725
|
||||
RUSTFLAGS: ${{ matrix.toolchain == 'nightly' && '--cfg nightly_yew' || '' }}
|
||||
run: cargo test --all-targets --workspace --exclude yew
|
||||
run: ls packages | grep -v "^yew$" | xargs -I {} cargo test --all-targets -p {}
|
||||
|
||||
- name: Run native tests for yew
|
||||
env:
|
||||
|
|
|
@ -31,7 +31,7 @@ jobs:
|
|||
fetch-depth: 0
|
||||
|
||||
- name: Config Git
|
||||
uses: oleksiyrudenko/gha-git-credentials@v2-latest
|
||||
uses: oleksiyrudenko/gha-git-credentials@v2.1.1
|
||||
with:
|
||||
token: "${{ secrets.YEWTEMPBOT_TOKEN }}"
|
||||
|
||||
|
|
|
@ -31,6 +31,12 @@ jobs:
|
|||
uses: actions/checkout@v3
|
||||
if: ${{ matrix.target == 'pr' }}
|
||||
|
||||
- name: Write Optimisation Flags
|
||||
run: |
|
||||
echo 'share-generics = true' >> .cargo/config.toml
|
||||
echo 'build-std = ["std", "panic_abort"]' >> .cargo/config.toml
|
||||
echo 'build-std-features = ["panic_immediate_abort"]' >> .cargo/config.toml
|
||||
|
||||
- name: Setup toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
---
|
||||
name: "Test Website"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/test-website.yml"
|
||||
- "packages/**/*"
|
||||
- "website/**/*"
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
website_tests:
|
||||
name: Tests Website Snippets
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
# for wasm-bindgen-cli, always use stable rust
|
||||
- name: Setup toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Install wasm-bindgen-cli
|
||||
shell: bash
|
||||
run: ./ci/install-wasm-bindgen-cli.sh
|
||||
|
||||
- name: Setup toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: nightly
|
||||
targets: wasm32-unknown-unknown
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- uses: browser-actions/setup-geckodriver@latest
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: nanasess/setup-chromedriver@v1
|
||||
|
||||
- name: Run website code snippet tests
|
||||
run: cargo test -p website-test --target wasm32-unknown-unknown
|
|
@ -1,49 +0,0 @@
|
|||
name: Tools & Examples
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/tools-examples.yml'
|
||||
- 'tools/**/*'
|
||||
- 'examples/**/*'
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
|
||||
jobs:
|
||||
clippy-fmt:
|
||||
name: Clippy & Format
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
workspace:
|
||||
- tools
|
||||
- examples
|
||||
runs:
|
||||
- clippy
|
||||
- rustfmt
|
||||
include:
|
||||
- toolchain: stable
|
||||
runs: clippy
|
||||
- toolchain: nightly
|
||||
runs: rustfmt
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{ matrix.toolchain }}
|
||||
components: ${{ matrix.runs }}
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Run clippy for ${{ matrix.workspace }}
|
||||
if: matrix.runs == 'clippy'
|
||||
run: cargo clippy --all-targets --all-features --manifest-path ${{ matrix.workspace }}/Cargo.toml -- -D warnings
|
||||
|
||||
- name: Run fmt for ${{ matrix.workspace }}
|
||||
if: matrix.runs == 'rustfmt'
|
||||
run: cargo fmt --all --manifest-path ${{ matrix.workspace }}/Cargo.toml -- --check
|
|
@ -1,5 +1,4 @@
|
|||
target/
|
||||
Cargo.lock
|
||||
|
||||
# backup files generated by rustfmt
|
||||
**/*.rs.bk
|
||||
|
|
File diff suppressed because it is too large
Load Diff
14
Cargo.toml
14
Cargo.toml
|
@ -1,9 +1,19 @@
|
|||
[workspace]
|
||||
members = [
|
||||
"packages/*",
|
||||
]
|
||||
exclude = [
|
||||
"tools/*",
|
||||
"examples/*",
|
||||
]
|
||||
resolver = "2"
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
opt-level = "z"
|
||||
|
||||
[profile.bench]
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
opt-level = 3
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[unstable]
|
||||
build-std = ["std", "panic_abort"]
|
||||
build-std-features = ["panic_immediate_abort"]
|
||||
share-generics = true
|
|
@ -1,4 +1,2 @@
|
|||
# trunk output
|
||||
dist/
|
||||
|
||||
!Cargo.lock
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
[workspace]
|
||||
members = [
|
||||
"*",
|
||||
]
|
||||
exclude = [
|
||||
"target",
|
||||
".cargo"
|
||||
]
|
||||
resolver = "2"
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
opt-level = "z"
|
|
@ -1 +0,0 @@
|
|||
!Cargo.lock
|
File diff suppressed because it is too large
Load Diff
|
@ -1,14 +0,0 @@
|
|||
[workspace]
|
||||
members = [
|
||||
"*",
|
||||
]
|
||||
exclude = [
|
||||
"target"
|
||||
]
|
||||
resolver = "2"
|
||||
|
||||
[profile.bench]
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
opt-level = 3
|
|
@ -14,10 +14,5 @@ wasm-bindgen = "0.2.83"
|
|||
web-sys = { version = "0.3.60", features = ["Window"]}
|
||||
yew = { version = "0.20.0", features = ["csr"], path = "../../packages/yew" }
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
|
||||
[package.metadata.wasm-pack.profile.release]
|
||||
wasm-opt = ['-O4']
|
||||
|
|
|
@ -14,10 +14,5 @@ wasm-bindgen = "0.2.83"
|
|||
web-sys = { version = "0.3.60", features = ["Window"]}
|
||||
yew = { version = "0.20.0", features = ["csr"], path = "../../packages/yew" }
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
|
||||
[package.metadata.wasm-pack.profile.release]
|
||||
wasm-opt = ['-O4']
|
||||
|
|
|
@ -4,6 +4,7 @@ version = "0.1.0"
|
|||
edition = "2021"
|
||||
build = "build.rs"
|
||||
publish = false
|
||||
rust-version = "1.62"
|
||||
|
||||
[dependencies]
|
||||
yew-agent = { path = "../../packages/yew-agent/" }
|
||||
|
|
Loading…
Reference in New Issue