2023-06-02 02:12:18 +00:00
|
|
|
extend = [{ path = "./cargo-make/main.toml" }]
|
2023-04-27 21:00:13 +00:00
|
|
|
|
2023-04-21 14:33:12 +00:00
|
|
|
[env]
|
|
|
|
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
|
2023-04-22 10:50:35 +00:00
|
|
|
CARGO_MAKE_CARGO_BUILD_TEST_FLAGS = ""
|
2023-04-21 14:33:12 +00:00
|
|
|
CARGO_MAKE_WORKSPACE_EMULATION = true
|
|
|
|
CARGO_MAKE_CRATE_WORKSPACE_MEMBERS = [
|
2023-07-26 14:43:20 +00:00
|
|
|
"animated_show",
|
|
|
|
"counter",
|
|
|
|
"counter_isomorphic",
|
|
|
|
"counters",
|
|
|
|
"counters_stable",
|
|
|
|
"counter_url_query",
|
|
|
|
"counter_without_macros",
|
|
|
|
"error_boundary",
|
|
|
|
"errors_axum",
|
|
|
|
"fetch",
|
|
|
|
"hackernews",
|
|
|
|
"hackernews_axum",
|
|
|
|
"js-framework-benchmark",
|
|
|
|
"leptos-tailwind-axum",
|
|
|
|
"login_with_token_csr_only",
|
|
|
|
"parent_child",
|
|
|
|
"router",
|
|
|
|
"session_auth_axum",
|
|
|
|
"slots",
|
|
|
|
"ssr_modes",
|
|
|
|
"ssr_modes_axum",
|
2023-08-15 10:19:20 +00:00
|
|
|
"suspense_tests",
|
2023-07-26 14:43:20 +00:00
|
|
|
"tailwind",
|
|
|
|
"tailwind_csr_trunk",
|
|
|
|
"timer",
|
|
|
|
"todo_app_sqlite",
|
|
|
|
"todo_app_sqlite_axum",
|
|
|
|
"todo_app_sqlite_viz",
|
|
|
|
"todomvc",
|
2023-04-21 14:33:12 +00:00
|
|
|
]
|
2023-06-17 22:19:01 +00:00
|
|
|
|
|
|
|
[tasks.gen-members]
|
|
|
|
workspace = false
|
|
|
|
description = "Generate the list of workspace members"
|
|
|
|
script = '''
|
|
|
|
examples=$(ls |
|
|
|
|
grep -v README.md |
|
|
|
|
grep -v Makefile.toml |
|
|
|
|
grep -v cargo-make |
|
|
|
|
grep -v gtk |
|
|
|
|
jq -R -s -c 'split("\n")[:-1]')
|
|
|
|
echo "CARGO_MAKE_CRATE_WORKSPACE_MEMBERS = $examples"
|
|
|
|
'''
|
2023-07-22 12:13:49 +00:00
|
|
|
|
2023-09-04 17:25:44 +00:00
|
|
|
[tasks.test-report]
|
2023-07-22 12:13:49 +00:00
|
|
|
workspace = false
|
2023-09-01 11:35:29 +00:00
|
|
|
description = "report ci test runners and tools for each example - OPTION: [all]"
|
2023-07-22 12:13:49 +00:00
|
|
|
script = '''
|
2023-08-28 15:08:22 +00:00
|
|
|
set -emu
|
|
|
|
|
2023-07-22 12:13:49 +00:00
|
|
|
BOLD="\e[1m"
|
|
|
|
GREEN="\e[0;32m"
|
|
|
|
ITALIC="\e[3m"
|
|
|
|
YELLOW="\e[0;33m"
|
|
|
|
RESET="\e[0m"
|
|
|
|
|
|
|
|
echo
|
2023-09-04 17:25:44 +00:00
|
|
|
echo "${YELLOW}Test Report${RESET}"
|
|
|
|
echo
|
2023-07-28 00:40:26 +00:00
|
|
|
echo "${ITALIC}Pass the option \"all\" to show all the examples${RESET}"
|
2023-07-22 12:13:49 +00:00
|
|
|
echo
|
|
|
|
|
2023-09-04 17:25:44 +00:00
|
|
|
makefile_paths=$(find . -name Makefile.toml -not -path '*/target/*' -not -path '*/node_modules/*' |
|
2023-07-28 00:40:26 +00:00
|
|
|
sed 's%./%%' |
|
|
|
|
sed 's%/Makefile.toml%%' |
|
|
|
|
grep -v Makefile.toml |
|
|
|
|
sort -u)
|
2023-07-22 12:13:49 +00:00
|
|
|
|
2023-07-28 00:40:26 +00:00
|
|
|
start_path=$(pwd)
|
2023-07-22 12:13:49 +00:00
|
|
|
|
2023-07-28 00:40:26 +00:00
|
|
|
for path in $makefile_paths; do
|
|
|
|
cd $path
|
2023-07-22 12:13:49 +00:00
|
|
|
|
2023-09-01 11:35:29 +00:00
|
|
|
crate_symbols=
|
2023-07-22 12:13:49 +00:00
|
|
|
|
2023-09-04 17:25:44 +00:00
|
|
|
test_count=$(grep -r --exclude-dir=target --exclude-dir=node_modules --fixed-strings "#[test]" | wc -l)
|
2023-07-28 00:40:26 +00:00
|
|
|
if [ $test_count -gt 0 ]; then
|
2023-09-01 11:35:29 +00:00
|
|
|
crate_symbols="T"
|
2023-07-22 12:13:49 +00:00
|
|
|
fi
|
|
|
|
|
2023-09-04 17:25:44 +00:00
|
|
|
rstest_count=$(grep -r --exclude-dir=target --exclude-dir=node_modules --fixed-strings "#[rstest]" | wc -l)
|
|
|
|
if [ $rstest_count -gt 0 ]; then
|
|
|
|
crate_symbols=$crate_symbols"R"
|
|
|
|
fi
|
|
|
|
|
2023-08-28 15:08:22 +00:00
|
|
|
while read -r line; do
|
|
|
|
case $line in
|
|
|
|
*"cucumber"*)
|
2023-09-01 11:35:29 +00:00
|
|
|
crate_symbols=$crate_symbols"C"
|
|
|
|
;;
|
|
|
|
*"fantoccini"*)
|
|
|
|
crate_symbols=$crate_symbols"F"
|
2023-08-28 15:08:22 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done <"./Cargo.toml"
|
|
|
|
|
2023-07-28 00:40:26 +00:00
|
|
|
while read -r line; do
|
|
|
|
case $line in
|
2023-09-04 17:25:44 +00:00
|
|
|
*"cargo-make/wasm-test"*)
|
2023-09-01 11:35:29 +00:00
|
|
|
crate_symbols=$crate_symbols"W"
|
2023-07-28 00:40:26 +00:00
|
|
|
;;
|
2023-09-04 17:25:44 +00:00
|
|
|
*"cargo-make/playwright"*)
|
2023-09-01 11:35:29 +00:00
|
|
|
crate_symbols=$crate_symbols"P"
|
2023-07-28 00:40:26 +00:00
|
|
|
;;
|
2023-09-04 17:25:44 +00:00
|
|
|
*"cargo-make/cargo-leptos-test"*)
|
2023-09-01 11:35:29 +00:00
|
|
|
crate_symbols=$crate_symbols"L"
|
2023-07-28 00:40:26 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done <"./Makefile.toml"
|
2023-07-22 12:13:49 +00:00
|
|
|
|
2023-09-01 11:35:29 +00:00
|
|
|
# Sort list of tools
|
|
|
|
sorted_crate_symbols=$(echo ${crate_symbols} | grep -o . | sort | tr -d "\n")
|
2023-08-28 15:08:22 +00:00
|
|
|
|
2023-09-01 11:35:29 +00:00
|
|
|
formatted_crate_symbols=" ➤ ${BOLD}${YELLOW}${sorted_crate_symbols}${RESET}"
|
|
|
|
crate_line=$path
|
2023-08-28 15:08:22 +00:00
|
|
|
if [ ! -z ${1+x} ]; then
|
2023-07-22 12:13:49 +00:00
|
|
|
# Show all examples
|
2023-09-01 11:35:29 +00:00
|
|
|
if [ ! -z $crate_symbols ]; then
|
|
|
|
crate_line=$crate_line$formatted_crate_symbols
|
|
|
|
fi
|
|
|
|
echo $crate_line
|
|
|
|
elif [ ! -z $crate_symbols ]; then
|
2023-07-22 12:13:49 +00:00
|
|
|
# Filter out examples that do not run tests in `ci`
|
2023-09-01 11:35:29 +00:00
|
|
|
crate_line=$crate_line$formatted_crate_symbols
|
|
|
|
echo $crate_line
|
2023-07-22 12:13:49 +00:00
|
|
|
fi
|
|
|
|
|
2023-07-28 00:40:26 +00:00
|
|
|
cd ${start_path}
|
2023-07-22 12:13:49 +00:00
|
|
|
done
|
2023-09-01 11:35:29 +00:00
|
|
|
|
2023-09-04 17:25:44 +00:00
|
|
|
c="${BOLD}${YELLOW}C${RESET} = Cucumber Test"
|
2023-09-01 11:35:29 +00:00
|
|
|
f="${BOLD}${YELLOW}F${RESET} = Fantoccini WebDriver"
|
2023-09-04 17:25:44 +00:00
|
|
|
l="${BOLD}${YELLOW}L${RESET} = Cargo Leptos Test"
|
|
|
|
p="${BOLD}${YELLOW}P${RESET} = Playwright Test"
|
2023-09-01 11:35:29 +00:00
|
|
|
r="${BOLD}${YELLOW}R${RESET} = RS Test"
|
2023-09-04 17:25:44 +00:00
|
|
|
u="${BOLD}${YELLOW}U${RESET} = Unit Test"
|
|
|
|
w="${BOLD}${YELLOW}W${RESET} = WASM Test"
|
2023-09-01 11:35:29 +00:00
|
|
|
|
2023-07-22 12:13:49 +00:00
|
|
|
echo
|
2023-09-04 17:25:44 +00:00
|
|
|
echo "${ITALIC}Keys:${RESET}\n $c\n $f\n $l\n $p\n $r\n $u\n $w"
|
2023-07-22 12:13:49 +00:00
|
|
|
echo
|
|
|
|
'''
|
2023-08-28 15:08:22 +00:00
|
|
|
|
|
|
|
# ALIASES
|
|
|
|
|
|
|
|
[tasks.tr]
|
2023-09-04 17:25:44 +00:00
|
|
|
alias = "test-report"
|