Upstream 2026.09.19 (#247) #66
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Clock Trails | |
| # Android showcase for the docs Report Gallery: replays the recorded "set a 7:30am | |
| # alarm" clock trail on an emulator and exports the storyboard / animated-timeline / | |
| # interactive-report assets the GitHub Pages build embeds at | |
| # https://block.github.io/trailblaze/reports/. | |
| # | |
| # Runs on push to main ONLY — deliberately NOT on pull_request. The same clock trail is | |
| # already exercised on every PR by the `android-tests-host-rpc` job in pr-checks.yml | |
| # (its script ends with `trailblaze trail trails/clock/set-alarm-730am/android.trail.yaml`), | |
| # so PR-level validation is covered there. This workflow exists purely to produce the | |
| # gallery artifact from a main run, so there's no reason to pay for a second Android | |
| # emulator boot on every PR. | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| # One run per ref; cancel a superseded queued run (mirrors the other trail workflows). | |
| concurrency: | |
| group: clock-trails-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Pre-build the trailblaze uber JAR (with WASM report template embedded) once and | |
| # publish it as an artifact for the downstream trails job — identical to the | |
| # build-uber-jar job in wikipedia-trails.yml / pr-checks.yml. WASM is what lets | |
| # `trailblaze report` emit the full interactive HTML report below. | |
| build-uber-jar: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: zulu | |
| java-version: 17 | |
| - name: Setup Gradle | |
| # Dependency + build cache reuse across runs (this workflow only runs | |
| # on main, so it reads and writes the cache). Mirrors pr-checks.yml. | |
| uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 | |
| with: | |
| cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 | |
| with: | |
| # Drop the action's default `tools` package. Google removed the obsolete SDK Tools | |
| # package from the repository, so `sdkmanager tools` fails outright on runner images | |
| # that no longer ship it preinstalled. `platform-tools` is what the build needs. | |
| packages: platform-tools | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| - name: Build trailblaze uber JAR (with WASM template embedded) | |
| env: | |
| TRAILBLAZE_GRADLE_EXTRA_ARGS: -Ptrailblaze.wasm=true --parallel | |
| run: ./scripts/install-trailblaze-source.sh | |
| - name: Stage artifact contents | |
| run: | | |
| mkdir -p trailblaze-uber-jar | |
| cp trailblaze-desktop/build/release/trailblaze.jar trailblaze-uber-jar/ | |
| cp trailblaze-desktop/build/release/trailblaze trailblaze-uber-jar/ | |
| ls -lh trailblaze-uber-jar/ | |
| - name: Upload uber JAR artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: trailblaze-uber-jar | |
| path: trailblaze-uber-jar/ | |
| if-no-files-found: error | |
| retention-days: 7 | |
| # Boots an Android emulator and replays the recorded clock trail via the host-RPC path | |
| # (the agent loop runs in-process on the host and dispatches device tools over RPC to | |
| # the bundled on-device APK). Mirrors the emulator setup of pr-checks.yml's | |
| # `android-tests-host-rpc` job — the one that's reliably green — then exports the docs | |
| # gallery assets from the resulting session. | |
| clock-trails: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| needs: build-uber-jar | |
| env: | |
| # Recordings-only — the trail has pre-recorded tool sequences, so LLM inference is | |
| # never invoked. A non-empty sentinel satisfies the provider/client wiring (same | |
| # pattern as android-tests-host-rpc in pr-checks.yml). | |
| OPENAI_API_KEY: no-key-set | |
| steps: | |
| - name: Enable KVM group perms | |
| if: runner.os == 'Linux' | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| ls /dev/kvm | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: zulu | |
| java-version: 17 | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 | |
| with: | |
| # Drop the action's default `tools` package. Google removed the obsolete SDK Tools | |
| # package from the repository, so `sdkmanager tools` fails outright on runner images | |
| # that no longer ship it preinstalled. `platform-tools` is what the build needs. | |
| packages: platform-tools | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| - name: Download prebuilt uber JAR | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: trailblaze-uber-jar | |
| path: trailblaze-uber-jar/ | |
| - name: Install trailblaze from prebuilt artifact | |
| env: | |
| TRAILBLAZE_ARTIFACT_DIR: ${{ github.workspace }}/trailblaze-uber-jar | |
| run: ./scripts/install-trailblaze-from-artifact.sh | |
| - name: Install ffmpeg (for the animated-timeline WebP) | |
| # The docs gallery's animated timeline.webp is muxed via `ffmpeg -c:v libwebp_anim` | |
| # (see pr_generate_report_assets.sh). The storyboard WebP uses bundled libwebp and | |
| # does not need ffmpeg, so a missing/older ffmpeg only degrades the animation. | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ffmpeg | |
| - name: Create and start emulator and run the clock trail (Linux) | |
| if: runner.os == 'Linux' | |
| uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b | |
| id: run-trail | |
| continue-on-error: true | |
| with: | |
| api-level: 34 | |
| arch: x86_64 | |
| disable-animations: true | |
| disk-size: 6000M | |
| heap-size: 600M | |
| profile: Nexus 6 | |
| # Reuses the exact host-RPC script the green pr-checks job runs; it ends with | |
| # `trailblaze trail trails/clock/set-alarm-730am/android.trail.yaml` and leaves | |
| # the session under ~/.trailblaze/logs for the export step below. | |
| script: ./.github/pr_run_android_tests_host_rpc.sh | |
| - name: Generate docs report-gallery assets | |
| # Storyboard + animated-timeline WebP + interactive HTML report, exported from the | |
| # session the clock trail just produced (read from ~/.trailblaze/logs). Consumed by | |
| # the GitHub Pages build for the Report Gallery. continue-on-error so a flaky | |
| # encoder never reds the run; the docs fall back to the last-published asset. | |
| if: always() | |
| continue-on-error: true | |
| run: ./.github/pr_generate_report_assets.sh | |
| - name: Upload docs report-gallery assets | |
| # Dedicated, predictably-named artifact the GitHub Pages workflow downloads from the | |
| # latest completed run on main (artifact name == docs-report-<slug>). | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-report-clock | |
| path: report-assets/ | |
| if-no-files-found: warn | |
| - name: Fail if the clock trail failed | |
| if: steps.run-trail.outcome == 'failure' | |
| run: | | |
| echo "Clock trail failed — failing the workflow" | |
| exit 1 |