CI: make extension-fast precheck plan-only

This commit is contained in:
joshavant 2026-03-17 21:10:07 -05:00
parent dffb9055c7
commit 0ec3ddc9af
No known key found for this signature in database
GPG Key ID: 4463B60B0DD49BC4

View File

@ -365,17 +365,21 @@ jobs:
let extensionFile = "";
let channelFile = "";
let extensionRepresentativeId = "";
let channelRepresentativeId = "";
for (const extensionId of orderedExtensionIds) {
const plan = resolveExtensionTestPlan({ targetArg: extensionId, cwd: process.cwd() });
for (const candidateId of orderedExtensionIds) {
const plan = resolveExtensionTestPlan({ targetArg: candidateId, cwd: process.cwd() });
if (plan.testFiles.length === 0) {
continue;
}
const firstFile = plan.testFiles[0] ?? "";
if (!extensionFile && plan.config === "vitest.extensions.config.ts") {
extensionRepresentativeId = plan.extensionId;
extensionFile = firstFile;
}
if (!channelFile && plan.config === "vitest.channels.config.ts") {
channelRepresentativeId = plan.extensionId;
channelFile = firstFile;
}
if (extensionFile && channelFile) {
@ -383,29 +387,41 @@ jobs:
}
}
appendFileSync(
process.env.GITHUB_OUTPUT,
`extension_id=${extensionRepresentativeId}\n`,
"utf8",
);
appendFileSync(
process.env.GITHUB_OUTPUT,
`channel_id=${channelRepresentativeId}\n`,
"utf8",
);
appendFileSync(process.env.GITHUB_OUTPUT, `extension_file=${extensionFile}\n`, "utf8");
appendFileSync(process.env.GITHUB_OUTPUT, `channel_file=${channelFile}\n`, "utf8");
EOF
- name: Run extension-fast import precheck
env:
EXTENSION_ID: ${{ steps.representative.outputs.extension_id }}
CHANNEL_ID: ${{ steps.representative.outputs.channel_id }}
EXTENSION_FILE: ${{ steps.representative.outputs.extension_file }}
CHANNEL_FILE: ${{ steps.representative.outputs.channel_file }}
run: |
set -euo pipefail
precheck_start="$(date +%s)"
if [ -n "$EXTENSION_FILE" ]; then
echo "Running extensions precheck: $EXTENSION_FILE"
pnpm exec vitest run --config vitest.extensions.config.ts --pool=forks --maxWorkers=1 --bail=1 "$EXTENSION_FILE"
if [ -n "$EXTENSION_ID" ]; then
echo "Running extensions plan precheck: $EXTENSION_ID"
pnpm test:extension "$EXTENSION_ID" --allow-empty --dry-run --json > /dev/null
fi
if [ -n "$CHANNEL_FILE" ]; then
echo "Running channels precheck: $CHANNEL_FILE"
pnpm exec vitest run --config vitest.channels.config.ts --pool=forks --maxWorkers=1 --bail=1 "$CHANNEL_FILE"
if [ -n "$CHANNEL_ID" ]; then
echo "Running channels plan precheck: $CHANNEL_ID"
pnpm test:extension "$CHANNEL_ID" --allow-empty --dry-run --json > /dev/null
fi
if [ -z "$EXTENSION_FILE" ] && [ -z "$CHANNEL_FILE" ]; then
if [ -z "$EXTENSION_ID" ] && [ -z "$CHANNEL_ID" ]; then
echo "::warning::extension-fast precheck found no representative test files."
fi
@ -413,6 +429,8 @@ jobs:
precheck_duration="$((precheck_end - precheck_start))"
{
echo "### extension-fast-precheck"
echo "- extension id: ${EXTENSION_ID:-none}"
echo "- channel id: ${CHANNEL_ID:-none}"
echo "- extension file: ${EXTENSION_FILE:-none}"
echo "- channel file: ${CHANNEL_FILE:-none}"
echo "- duration: ${precheck_duration}s"