perf(ci): skip unused test runtime uploads (#14903)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-11-27 22:17:25 +08:00
1 parent bbed314998
commit e7c203a5d9
2 files changed
+23 -1

No files matched your search

+3 -1
View File
@@ -568,7 +568,9 @@ jobs:
github-token: ${{ github.token }}
path: .cache/ci-test-history
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: needs.changes.outputs.tier != 'warm'
if: >-
(needs.changes.outputs.code == 'true' && needs.changes.outputs.tier != 'warm') ||
needs.changes.outputs.sqlite == 'true'
with:
name: rea-test-runtime
overwrite: true
@@ -103,6 +103,26 @@ it("fetches historical durations when portable tests can use them", async () =>
}
});
it("uploads the test runtime when portable tests or SQLite need it", async () => {
const steps = (await workflow()).build!.steps!;
const condition = z
.string()
.parse(steps.find((step) => step.with?.name === "rea-test-runtime")?.if);
for (const [tier, code, sqlite, expected] of [
["fast", "false", "false", false],
["fast", "true", "false", true],
["fast", "false", "true", true],
["warm", "true", "false", false],
["full", "true", "true", true],
] as const) {
expect(
evaluateCondition(condition, {
needs: { changes: { outputs: { tier, code, sqlite } } },
}),
).toBe(expected);
}
});
it("looks up a baseline only when main selection can use it", async () => {
const steps = (await workflow()).changes!.steps!;
const qualification = steps.findIndex((step) => step.id === "qualification");