Files
nocobase/scripts/release-test-shard.sh
T
PiEgg 1cdfaf4cd1 ci: run release build, test and pack in parallel (#485)
Split the release prepare job so build-and-pack and a two-shard test job run in parallel after versioning, skip the templates in the release build, run pack:check in parallel without rebuilding, resolve only @nocobase packages from npm.nocobase.ai, and start the Hub image alongside the GitHub Release.
2026-09-29 11:02:34 +08:00

36 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Run one shard of the release test suite from the root of a release checkout.
#
# Usage: release-test-shard.sh <plugins|others> <include-templates: true|false>
#
# The plugin suites are the slowest by a wide margin (about two thirds of the total), so they get a runner of their
# own and everything else shares the other. Together the two shards cover what `pnpm test` covers. The template
# suites run only when include-templates is true: otherwise the create-app smoke test runs them against the packed
# packages, which is the stronger check.
set -euo pipefail
SHARD="${1:?usage: release-test-shard.sh <plugins|others> <include-templates>}"
INCLUDE_TEMPLATES="${2:?usage: release-test-shard.sh <plugins|others> <include-templates>}"
# --no-sort starts each package as soon as a slot is free instead of waiting for a whole dependency level.
RECURSIVE=(-r --no-sort --if-present)
case "$SHARD" in
plugins)
pnpm "${RECURSIVE[@]}" --filter './packages/plugins/**' test
;;
others)
FILTERS=(--filter '!./packages/plugins/**')
if [ "$INCLUDE_TEMPLATES" != "true" ]; then
FILTERS+=(--filter '!./packages/templates/**')
fi
pnpm scripts:test
pnpm "${RECURSIVE[@]}" "${FILTERS[@]}" test
pnpm db:test
;;
*)
echo "::error::Unknown test shard: $SHARD" >&2
exit 1
;;
esac