yew/Makefile.toml
Matt 6669d1873e
Optimize CI caching and path filtering (#2340)
* fix docs.rs logo url

* fix formatting

* bump docusaurus to beta14

* bring back the semicolon

* cache npm for build-website workflow

* Add prebuilt cargo-sweep binary

* Optimize website CI

* per-job caching, stale cache invalidation

* extract fmt job as workflow
move website test as a prerequisite for publish

* fix typo in cargo-sweep executable path

* chmod +x

* rename to main-checks.yml

* --exclude has to be used with --workspace

* revert accidental revert

* Switch from cargo-sweep to rust-cache

* link to this related issue of extra brackets

* remove blanks

* exclude website-test in main tests

* rename suffixes from .mdx to .md

* replace actions-rs/install with wasm-pack-action

fixes #2351

* shouldn't ignore .md because website snippet tests depends on .md files and there can be
#[doc(include("../some.md"))] in the code

* restore accidentally deleted mdx files

* include tools/website-test (for real this time)
2022-01-18 10:49:11 +01:00

121 lines
2.7 KiB
TOML

######################
#
# public tasks:
# * pr-flow
# * lint
# * lint-release
# * tests
# * benchmarks
#
# Run `cargo make --list-all-steps` for more details.
#
######################
[config]
min_version = "0.32.4"
default_to_workspace = false
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CARGO_MAKE_CLIPPY_ARGS = "-- --deny=warnings"
[config.modify_core_tasks]
private = true
namespace = "core"
[tasks.pr-flow]
toolchain = "stable"
category = "Checks"
description = "Lint and test"
run_task = { name = ["lint", "lint-release", "tests"], fork = true }
[tasks.lint]
category = "Checks"
description = "Check formatting and run Clippy"
run_task = { name = ["lint-flow"], fork = true }
[tasks.tests]
category = "Testing"
description = "Run all tests"
dependencies = ["tests-setup"]
env = { CARGO_MAKE_WORKSPACE_SKIP_MEMBERS = ["**/examples/*", "**/packages/changelog"] }
run_task = { name = ["test-flow", "doc-test-flow", "ssr-test", "website-test"], fork = true }
[tasks.benchmarks]
category = "Testing"
description = "Run benchmarks"
env = { CARGO_MAKE_WORKSPACE_SKIP_MEMBERS = ["**/examples/*"] }
run_task = { name = "bench-flow", fork = true }
[tasks.lint-flow]
private = true
workspace = true
dependencies = ["core::check-format-flow", "core::clippy-flow"]
# Needed, because we have some code differences between debug and release builds
[tasks.lint-release]
category = "Checks"
workspace = true
command = "cargo"
args = ["clippy", "--all-targets", "--release", "--", "--deny=warnings"]
[tasks.tests-setup]
private = true
script_runner = "@duckscript"
script = [
"""
test_flags = array --headless --firefox
yew_test_features = set wasm_test
yew_test_flags = array_join ${test_flags} " "
echo "running tests with flags: ${yew_test_flags} and features: ${yew_test_features}"
set_env YEW_TEST_FLAGS ${yew_test_flags}
set_env YEW_TEST_FEATURES ${yew_test_features}
""",
]
[tasks.test-flow]
private = true
workspace = true
dependencies = ["test"]
[tasks.test]
private = true
command = "cargo"
args = ["test", "--all-targets", "--workspace", "--exclude", "website-test"]
[tasks.doc-test-flow]
private = true
workspace = true
dependencies = ["doc-test"]
[tasks.doc-test]
private = true
command = "cargo"
args = ["test", "--doc"]
[tasks.website-test]
command = "cargo"
args = ["test", "-p", "website-test"]
[tasks.bench-flow]
private = true
workspace = true
dependencies = ["bench"]
[tasks.bench]
private = true
command = "cargo"
args = ["bench"]
[tasks.generate-change-log]
category = "Maintainer processes"
toolchain = "stable"
command = "cargo"
args = ["run","-p","changelog", "--release", "${@}"]
[tasks.ssr-test]
env = { CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS = ["**/packages/yew"] }
private = true
workspace = true