diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e25b6706b21..543c258392b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/tests/boundary/filesystem/ciFeedback.test.ts b/tests/boundary/filesystem/ciFeedback.test.ts index ac070787b50..929b1c11e4e 100644 --- a/tests/boundary/filesystem/ciFeedback.test.ts +++ b/tests/boundary/filesystem/ciFeedback.test.ts @@ -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");