mirror of
https://github.com/stablyai/orca.git
synced 2026-10-05 16:02:22 +00:00
A concurrency slot is charged per job, not per core, and the account's cap is the scarce resource: standard runner minutes are free and unlimited on a public repository. Two paths spent slots that bought nothing. The unit matrix ran eight fixed shards averaging 6.5 minutes each, 3384 job-slots a day and 68% of all slot demand, while the arm pool queued 10.5 minutes at p95 — the queue was the oversharding. Five shards run the same work in ~10.5 minutes each for three fewer slots per run. Bun profile persistence escalated to all six platforms on `config/`, `resources/` and `.github/` wholesale, which took 36.5% of the last 1100 commits through the full matrix where a platform-flavoured predicate takes 19%. A pull request now qualifies one platform unless the change is platform- flavoured, and the push to main re-qualifies all six, so an unescalated miss surfaces minutes after merge rather than at the next cron. Missing changed-file evidence and an unavailable dependency graph still fail closed to all six.
172 lines
6.0 KiB
YAML
172 lines
6.0 KiB
YAML
name: Bun profile persistence
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
paths:
|
|
- 'src/**'
|
|
- 'config/**'
|
|
- 'native/**'
|
|
- 'tests/**'
|
|
- 'resources/**'
|
|
- 'package.json'
|
|
- 'pnpm-lock.yaml'
|
|
- 'pnpm-workspace.yaml'
|
|
- 'tsconfig.json'
|
|
- '.npmrc'
|
|
- '.pnpmfile.cjs'
|
|
- '.github/actions/install-node-dependencies/**'
|
|
- '.github/workflows/bun-profile-tests.yml'
|
|
# The pull request qualifies one platform for an unflavoured change; this is where all six
|
|
# are re-qualified, so a platform break surfaces minutes after merge instead of next cron.
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'src/**'
|
|
- 'config/**'
|
|
- 'native/**'
|
|
- 'tests/**'
|
|
- 'resources/**'
|
|
- 'package.json'
|
|
- 'pnpm-lock.yaml'
|
|
- 'pnpm-workspace.yaml'
|
|
- 'tsconfig.json'
|
|
- '.npmrc'
|
|
- '.pnpmfile.cjs'
|
|
- '.github/actions/install-node-dependencies/**'
|
|
- '.github/workflows/bun-profile-tests.yml'
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '30 11 * * *'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: bun-profile-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
changes:
|
|
if: github.event_name == 'pull_request'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
outputs:
|
|
should_run: ${{ steps.scope.outputs.should_run }}
|
|
qualification: ${{ steps.scope.outputs.qualification }}
|
|
runners: ${{ steps.scope.outputs.runners }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 2
|
|
persist-credentials: false
|
|
- uses: ./.github/actions/install-node-dependencies
|
|
- name: Detect Bun build and test inputs
|
|
id: scope
|
|
shell: bash
|
|
run: |
|
|
# Compare the tested merge with its base, retaining both sides of renames.
|
|
if git diff --name-only --no-renames -z HEAD^1 HEAD > "$RUNNER_TEMP/bun-changes"; then
|
|
node config/scripts/bun-profile-change-scope.mjs "$RUNNER_TEMP/bun-changes"
|
|
else
|
|
echo 'should_run=true' >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
persistence:
|
|
needs: changes
|
|
# Missing/failed detection runs the full matrix; manual runs remain unconditional.
|
|
# A draft carries no platform verdict; readiness re-triggers this workflow. Spelled against
|
|
# the event name so the push and schedule paths do not rest on a null property comparison.
|
|
if: >-
|
|
${{ !cancelled() && needs.changes.outputs.should_run != 'false' &&
|
|
(github.event_name != 'pull_request' || github.event.pull_request.draft != true) }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: ${{ fromJSON(needs.changes.outputs.runners || '["ubuntu-22.04","ubuntu-24.04-arm","macos-14","macos-15-intel","windows-2022","windows-11-arm"]') }}
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 20
|
|
env:
|
|
ORCA_BACKGROUND_LAUNCH: '1'
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
persist-credentials: false
|
|
- uses: ./.github/actions/install-node-dependencies
|
|
with:
|
|
native-runtime: ${{ runner.os == 'Windows' && 'node' || 'none' }}
|
|
# build:orcad reuses the host addon validated by native-runtime preparation.
|
|
- run: pnpm build:orcad
|
|
- run: pnpm test:bun:profile --artifact
|
|
- uses: actions/setup-node@v6
|
|
if: runner.arch == 'X64'
|
|
with:
|
|
node-version: '18'
|
|
- name: Verify Node 18 loads and hands off to bundled Bun
|
|
if: runner.arch == 'X64'
|
|
run: |
|
|
node out/orcad/orcad.js --orcad-smoke-load-check
|
|
node out/orcad/orcad.js --orcad-profile-state-preflight 00000000-0000-4000-8000-000000000018
|
|
|
|
linux_glibc_floor:
|
|
needs: [changes, persistence]
|
|
# A failed smoke already blocks qualification; missing scope still selects every platform.
|
|
if: >-
|
|
${{ !cancelled() && needs.persistence.result == 'success' &&
|
|
needs.changes.outputs.should_run != 'false' &&
|
|
needs.changes.outputs.qualification != 'false' }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-22.04, ubuntu-24.04-arm]
|
|
runs-on: ${{ matrix.os }}
|
|
container: ubuntu:20.04
|
|
timeout-minutes: 20
|
|
env:
|
|
ORCA_BACKGROUND_LAUNCH: '1'
|
|
steps:
|
|
- name: Install Ubuntu 20.04 prerequisites
|
|
run: apt-get update && apt-get install -y build-essential ca-certificates git python3 unzip
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
persist-credentials: false
|
|
- name: Trust the checked-out workspace
|
|
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
- uses: ./.github/actions/install-node-dependencies
|
|
- run: pnpm build:orcad
|
|
- run: pnpm test:bun:profile --artifact
|
|
|
|
linux_musl:
|
|
needs: [changes, persistence]
|
|
# A failed smoke already blocks qualification; missing scope still selects every platform.
|
|
if: >-
|
|
${{ !cancelled() && needs.persistence.result == 'success' &&
|
|
needs.changes.outputs.should_run != 'false' &&
|
|
needs.changes.outputs.qualification != 'false' }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-22.04, ubuntu-24.04-arm]
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 20
|
|
env:
|
|
ORCA_BACKGROUND_LAUNCH: '1'
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
persist-credentials: false
|
|
- name: Verify native Alpine artifact and persistence
|
|
run: |
|
|
docker run --rm --init -i \
|
|
-e ORCA_BACKGROUND_LAUNCH=1 \
|
|
-v "$GITHUB_WORKSPACE:/work" -w /work \
|
|
node:24-alpine3.23 sh -s <<'BUN_QUALIFICATION'
|
|
set -eu
|
|
apk add --no-cache bash git libstdc++ python3 make g++
|
|
git config --global --add safe.directory /work
|
|
npm install -g "$(node -p "require('./package.json').packageManager.split('+')[0]")"
|
|
pnpm install --frozen-lockfile --ignore-scripts
|
|
pnpm build:orcad
|
|
pnpm test:bun:profile --artifact
|
|
BUN_QUALIFICATION
|