Files
orca/.github/workflows/release-javascript-benchmark.yml
T
8c78f82369 ci: bound every job in pull-request workflows with timeout-minutes (#28784)
* Bound every pull request CI job with timeout-minutes

* ci: bound the PR-triggered jobs added since #28784 with timeout-minutes

Sized from recent run times: containers 1.2 min max, mac-native-owner-smoke 5.5,
contract 1.2. Secret scan (1.8 max) and mobile_web_app (5.4 max) get roomier limits.

* ci: check PR job time limits in code_paths so workflow-only PRs are covered

A PR that changes only mobile.yml or cloud-verify.yml skips the root unit
shards, so the timeout test never ran for it. Run the check from code_paths,
which runs on every PR, as check-required-pr-context already does.

* ci: use a uniform 3h ceiling on newly bounded PR jobs to stop runaway jobs

The goal is only to stop jobs that would otherwise run to GitHub's 6h
default, not to tune per-job limits. The guard keeps requiring a limit
below 360 minutes on every PR job but no longer enforces a lower value.

---------

Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>
Co-authored-by: Neil <neil@stably.ai>
2026-11-05 19:59:47 -08:00

138 lines
5.0 KiB
YAML

name: Release JavaScript comparison
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, converted_to_draft]
paths: ['.github/workflows/release-javascript-benchmark.yml']
workflow_dispatch:
permissions:
contents: read
concurrency:
group: release-javascript-comparison-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
ORCA_BACKGROUND_LAUNCH: '1'
ORCA_DIAGNOSTICS_TOKEN_URL: https://www.onorca.dev/diagnostics/token
ORCA_POSTHOG_WRITE_KEY: ci-build-comparison
NODE_OPTIONS: --max-old-space-size=4096
jobs:
bundle:
if: github.event_name != 'pull_request' || github.event.pull_request.draft != true
uses: ./.github/workflows/release-javascript.yml
with:
ref: ${{ github.sha }}
secrets:
ORCA_POSTHOG_WRITE_KEY: ci-build-comparison
measure:
needs: bundle
name: ${{ matrix.mode }} ${{ matrix.host.platform }} ${{ matrix.host.arch }}
runs-on: ${{ matrix.host.os }}
timeout-minutes: 30
strategy:
fail-fast: false
max-parallel: 8
matrix:
mode: [baseline, shared]
host:
- os: ubuntu-latest
platform: linux
arch: x64
- os: ubuntu-24.04-arm
platform: linux
arch: arm64
- os: windows-2022
platform: win32
arch: x64
- os: macos-15
platform: darwin
arch: arm64
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.bundle.outputs.source_sha }}
persist-credentials: false
- uses: ./.github/actions/install-node-dependencies
with:
native-runtime: node
persist-native-cache: 'false'
- uses: ./.github/actions/install-mobile-dependencies
- name: Install Linux provider dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y python3-gi gir1.2-atspi-2.0 at-spi2-core xclip xdotool
- name: Resolve build identity
shell: bash
run: |
RELEASE_TAG="v$(node -p 'require("./package.json").version')"
export RELEASE_TAG
RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release/javascript-artifacts/release-javascript-artifact.mjs'
if [ ! -f "$RELEASE_JAVASCRIPT_ARTIFACT" ]; then
RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release-javascript-artifact.mjs'
fi
echo "ORCA_BUILD_IDENTITY=$(node "$RELEASE_JAVASCRIPT_ARTIFACT" identity)" >> "$GITHUB_ENV"
- name: Download shared JavaScript
if: matrix.mode == 'shared'
uses: actions/download-artifact@v8
with:
name: release-javascript
path: .build/release-javascript
- name: Measure release build
shell: bash
env:
MEASUREMENT_MODE: ${{ matrix.mode }}
ORCA_RELEASE_JAVASCRIPT_SOURCE_SHA: ${{ needs.bundle.outputs.source_sha }}
run: |
RELEASE_JAVASCRIPT_BENCHMARK='config/scripts/release/javascript-artifacts/release-javascript-benchmark.mjs'
if [ ! -f "$RELEASE_JAVASCRIPT_BENCHMARK" ]; then
RELEASE_JAVASCRIPT_BENCHMARK='config/scripts/release-javascript-benchmark.mjs'
fi
node "$RELEASE_JAVASCRIPT_BENCHMARK" "$MEASUREMENT_MODE"
- uses: actions/upload-artifact@v7
with:
name: release-javascript-measurement-${{ matrix.mode }}-${{ matrix.host.platform }}-${{ matrix.host.arch }}
path: .build/release-javascript-measurements/
retention-days: 7
comparison:
needs: [bundle, measure]
runs-on: ubuntu-slim
timeout-minutes: 180
permissions:
contents: read
actions: read
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.bundle.outputs.source_sha }}
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version-file: package.json
check-latest: true
- uses: ./.github/actions/install-node-dependencies
- uses: actions/download-artifact@v8
with:
pattern: release-javascript-measurement-*
path: .build/release-javascript-measurements
- name: Compare build and transfer timings
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/jobs?per_page=100" > .build/release-javascript-measurements/jobs.json
RELEASE_JAVASCRIPT_BENCHMARK='config/scripts/release/javascript-artifacts/release-javascript-benchmark.mjs'
if [ ! -f "$RELEASE_JAVASCRIPT_BENCHMARK" ]; then
RELEASE_JAVASCRIPT_BENCHMARK='config/scripts/release-javascript-benchmark.mjs'
fi
node "$RELEASE_JAVASCRIPT_BENCHMARK" summary
cat .build/release-javascript-measurements/comparison.md >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@v7
if: always()
with:
name: release-javascript-comparison
path: .build/release-javascript-measurements/comparison.md
retention-days: 30