diff --git a/.github/workflows/e2e-derived-data-seed.yml b/.github/workflows/e2e-derived-data-seed.yml new file mode 100644 index 000000000000..aae0fbe8ed68 --- /dev/null +++ b/.github/workflows/e2e-derived-data-seed.yml @@ -0,0 +1,56 @@ +name: E2E DerivedData seed + +# test-e2e.yml builds start from the DerivedData that a main-contained dispatch +# of that workflow published (#14016), so a test-only change recompiles only +# the tests. Focused dispatches test pull request revisions, which never +# publish, and nothing dispatches main on a schedule: seeds so far came from +# hand dispatches, and each artifact expires after 3 days. +# +# Every 6 hours this dispatches test-e2e.yml on main's HEAD with one fast suite, +# unless that SHA already has a seed dispatch. It dispatches instead of calling +# so the run keeps the identity e2e_warm_derived_data.py trusts (path +# test-e2e.yml, event workflow_dispatch, branch main). +on: + schedule: + - cron: "41 */6 * * *" + workflow_dispatch: + +permissions: {} + +jobs: + dispatch: + name: Dispatch a main build of test-e2e.yml + if: ${{ github.ref == 'refs/heads/main' }} + runs-on: ${{ vars.LINUX_RUNNER || 'blacksmith-4vcpu-ubuntu-2404' }} + timeout-minutes: 5 + concurrency: + group: e2e-derived-data-seed + cancel-in-progress: false + permissions: + actions: write + contents: read + steps: + - name: Dispatch unless main's HEAD already has a seed + env: + GH_TOKEN: ${{ github.token }} + # 36 ms on CI: the seed exists for its build, not its test. + SEED_FILTER: cmuxTests/CmuxPopoverGroupTests + run: | + set -euo pipefail + head_sha="$(gh api "repos/$GITHUB_REPOSITORY/branches/main" --jq '.commit.sha')" + # test-e2e.yml's run name carries the tested ref and the dispatch id. + # A run that built but failed its test still published, so only runs + # that never finished count as missing. + existing="$(gh run list --repo "$GITHUB_REPOSITORY" --workflow test-e2e.yml \ + --branch main --event workflow_dispatch --limit 300 --json displayTitle,conclusion \ + --jq "[.[] | select((.displayTitle | contains(\"@ $head_sha\")) and (.displayTitle | contains(\"[e2e-derived-data-seed-\")) and (.conclusion != \"cancelled\" and .conclusion != \"timed_out\" and .conclusion != \"startup_failure\"))] | length")" + if [ "$existing" != "0" ]; then + echo "main's HEAD $head_sha already has a seed dispatch." >> "$GITHUB_STEP_SUMMARY" + exit 0 + fi + gh workflow run test-e2e.yml --repo "$GITHUB_REPOSITORY" --ref main \ + -f ref="$head_sha" \ + -f test_filter="$SEED_FILTER" \ + -f dispatch_id="e2e-derived-data-seed-$GITHUB_RUN_ID" \ + -f record_video=false + echo "Dispatched a DerivedData seed build of $head_sha." >> "$GITHUB_STEP_SUMMARY" diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index d31e0501310e..47285584a906 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -304,8 +304,11 @@ jobs: id: product-key run: python3 scripts/ci/reuse_app_host_products.py key "$CMUX_DERIVED_DATA_PATH" + # e2e-derived-data-seed.yml dispatches exist to publish DerivedData, + # which only a compile produces, so they never adopt a product. - name: Reuse a compiled product instead of building one id: reuse + if: ${{ !startsWith(inputs.dispatch_id, 'e2e-derived-data-seed-') }} continue-on-error: true env: GH_TOKEN: ${{ github.token }}