perf(ci): narrow PR test selection fallbacks, unify stray lanes, and cache Windows builds (#11797)

* fix(ci): narrow false full-suite fallbacks in PR test selection

* ci: unify Go and Android lanes under CI and scope CodeQL and cache retention

* perf(ci): trim classification checkout, cache MinGW/Windows builds, and rebalance full shards

* fix(ci): calibrate PR CI health window and CI timings schedule

* perf(ci): fix script-basename substring fallbacks and trim macOS/Windows lane overhead

* fix(ci): address PR review findings across CodeQL, Windows cache key, PR health, and docs

* perf(tests): share canonical MCP catalog setup and avoid Ajv $ref expansion

* fix(ci): align selected test shard limits (50 files, max 8 shards) with 400-file cap
This commit is contained in:
morluto authored and GitHub committed 2026-11-16 21:27:46 -05:00
1 parent 575c0f1443
commit 30d5ad2a48
27 files changed
+1236 -481

No files matched your search

+6 -4
View File
@@ -4,6 +4,7 @@ on:
workflow_run:
workflows: ["CI"]
types: [completed]
branches: [main]
# Qualification calls ci.yml with actions: read. A nested workflow cannot raise
# that token, so cache deletion stays in this workflow.
@@ -21,13 +22,13 @@ jobs:
# Restrict the triggering-source checkout to same-repository default-branch
# CI events. The helper runs from this trusted workflow revision; triggering
# source is used only for cache identity and is never executed. Static and
# build save snapshots before later lanes finish, so failed, timed-out, or
# cancelled runs still retain those snapshots.
# build save snapshots before later lanes finish, so failed or timed-out
# runs still retain those snapshots, while queue-superseded cancelled runs
# never published caches.
if: >-
(github.event.workflow_run.conclusion == 'success' ||
github.event.workflow_run.conclusion == 'failure' ||
github.event.workflow_run.conclusion == 'timed_out' ||
github.event.workflow_run.conclusion == 'cancelled') &&
github.event.workflow_run.conclusion == 'timed_out') &&
github.event.workflow_run.head_repository.full_name == github.repository &&
github.event.workflow_run.head_branch == github.event.repository.default_branch &&
(github.event.workflow_run.event == 'push' ||
@@ -60,5 +61,6 @@ jobs:
CACHE_KNIP_PREFIX: knip-meta-v1-${{ runner.os }}-
CACHE_KNIP_KEEP_KEY: knip-meta-v1-${{ runner.os }}-${{ hashFiles('triggering-source/knip.json', 'triggering-source/tsconfig.json', 'triggering-source/package.json', 'triggering-source/package-lock.json') }}-${{ github.event.workflow_run.head_sha }}
CACHE_PORTABLE_PREFIX: rea-portable-build-v2-${{ runner.os }}-${{ runner.arch }}-
CACHE_WINDOWS_BUILD_PREFIX: rea-windows-build-v1-Windows-X64-
DEDUPE_NPM_DOWNLOADS: "true"
run: node trusted-retention/scripts/ci/cache-retention.mjs
+1 -1
View File
@@ -2,7 +2,7 @@ name: CI timings
on:
schedule:
- cron: "17 * * * *"
- cron: "17 */6 * * *"
workflow_dispatch:
concurrency:
+101 -22
View File
@@ -84,6 +84,8 @@ jobs:
agentenv: ${{ steps.plan.outputs.agentenv }}
nativeaot: ${{ steps.plan.outputs.nativeaot }}
ghidra_bridge: ${{ steps.plan.outputs.ghidra_bridge }}
go_binary: ${{ steps.plan.outputs.go_binary }}
android_metadata: ${{ steps.plan.outputs.android_metadata }}
website: ${{ steps.plan.outputs.website }}
matrix: ${{ steps.plan.outputs.matrix }}
test_selection: ${{ steps.plan.outputs.test_selection }}
@@ -94,6 +96,7 @@ jobs:
with:
ref: ${{ inputs.source_sha || github.sha }}
fetch-depth: 0
filter: blob:none
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: .nvmrc
@@ -334,7 +337,7 @@ jobs:
fail-fast: ${{ github.event_name == 'pull_request' && needs.changes.outputs.tier == 'fast' }}
matrix:
# scripts/ci/test-selection.mjs owns the shard counts: twelve fast
# built shards, six full-qualification shards with coverage, or one
# built shards, twelve full-qualification shards with coverage, or one
# job per group of a selected PR subset.
shard: ${{ fromJSON(needs.changes.outputs.test_shards) }}
steps:
@@ -429,7 +432,8 @@ jobs:
needs.changes.outputs.web_source_map == 'true' ||
needs.changes.outputs.agentenv == 'true' ||
needs.changes.outputs.packet_capture == 'true' ||
needs.changes.outputs.signal_recording == 'true'
needs.changes.outputs.signal_recording == 'true' ||
needs.changes.outputs.go_binary == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
@@ -688,7 +692,28 @@ jobs:
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: .nvmrc
# Include runner ImageOS/ImageVersion and a UTC date bucket so runner image
# rollouts invalidate immediately and cached MinGW outputs refresh daily.
- name: Compute Windows native cache key
id: windows-native-key
env:
SOURCE_HASH: ${{ hashFiles('native/windows/**', 'src/domain/windowsNativeArtifact*.ts', 'src/domain/dosMz*.ts', 'src/domain/peCoffHeader*.ts', 'scripts/build-windows-native.mjs', 'scripts/verify-windows-native-artifact.mjs', 'scripts/lib/verifier-source-loader.mjs', 'tests/fixtures/windows-native-inspection-failure.cc', 'tests/fixtures/windows/processBoundary.cc', 'package.json') }}
run: |
utc_date="$(date -u +%Y-%m-%d)"
printf 'key=rea-windows-native-v2-%s-%s-%s-%s-%s-%s\n' \
"${RUNNER_OS}" "${RUNNER_ARCH}" "${ImageOS:-ubuntu}" "${ImageVersion:-rolling}" "${utc_date}" "${SOURCE_HASH}" \
>> "${GITHUB_OUTPUT}"
- name: Restore Windows native build outputs
id: windows-native-cache
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
native/windows/build/
.cache/windows-native-inspection-fixture/
.cache/windows-process-boundary/
key: ${{ steps.windows-native-key.outputs.key }}
- name: Prepare cross compiler
if: steps.windows-native-cache.outputs.cache-hit != 'true'
run: |
# Slow Azure archive transfers can exhaust the job before compilation.
# Keep the same signed packages and avoid slow HTTP mirror fallback.
@@ -699,9 +724,11 @@ jobs:
done
sudo apt-get update
sudo apt-get install --no-install-recommends -y g++-mingw-w64-x86-64
- run: npm run build:windows-native
- if: steps.windows-native-cache.outputs.cache-hit != 'true'
run: npm run build:windows-native
- run: npm run verify:windows-native:artifact
- run: node scripts/build-windows-native.mjs --inspection-fixture
- if: steps.windows-native-cache.outputs.cache-hit != 'true'
run: node scripts/build-windows-native.mjs --inspection-fixture
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: windows-native-inspection-fixture
@@ -712,11 +739,30 @@ jobs:
# results from a separate executable. Cross-build it in the lane that
# already has MinGW so the Windows job can observe them too.
- name: Build Windows process boundary fixture
if: steps.windows-native-cache.outputs.cache-hit != 'true'
run: |
mkdir -p .cache/windows-process-boundary
x86_64-w64-mingw32-g++ -municode -std=c++17 -O2 -static -Wall -Wextra \
-o .cache/windows-process-boundary/process-boundary.exe \
tests/fixtures/windows/processBoundary.cc -ladvapi32
- name: Verify cross-built Windows test fixtures
run: >-
node -e "const fs = require('node:fs');
for (const p of ['.cache/windows-native-inspection-fixture/manifest.json', '.cache/windows-process-boundary/process-boundary.exe']) {
if (fs.statSync(p).size <= 0) throw new Error('empty Windows fixture: ' + p); }"
- name: Save validated Windows native build outputs
if: >-
success() &&
steps.windows-native-cache.outputs.cache-hit != 'true' &&
github.ref == format('refs/heads/{0}', github.event.repository.default_branch) &&
(github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
native/windows/build/
.cache/windows-native-inspection-fixture/
.cache/windows-process-boundary/
key: ${{ steps.windows-native-cache.outputs.cache-primary-key }}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: windows-process-boundary-fixture
@@ -766,9 +812,17 @@ jobs:
console.log(JSON.stringify({ platform: process.platform, architecture: process.arch, node: process.version }));"
- run: npm ci
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
if: matrix.os != 'windows-latest'
with:
name: rea-build-cache
path: .turbo/cache/
- name: Restore Windows Turbo build cache
if: matrix.os == 'windows-latest'
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: .turbo/cache/
key: rea-windows-build-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.nvmrc', '.npmrc', 'package-lock.json') }}-${{ github.sha }}
restore-keys: rea-windows-build-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.nvmrc', '.npmrc', 'package-lock.json') }}-
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: windows-native-controls
@@ -819,21 +873,19 @@ jobs:
env:
REA_ARTIFACT_NODE_COMPILE_CACHE: ${{ runner.temp }}/rea-artifact-node-cache
run: |
npm run verify:keyed-archive
npm run verify:asset-catalog
npm run verify:macos-bundle
npm run verify:legacy-simulator
npm run verify:apple-dispatch
npm run verify:interface-builder
- name: Verify portable iNES CLI, MCP and source boundaries
npm run build:cached
node scripts/verify/apple/keyed-archive.mjs
node scripts/verify/apple/asset-catalog.mjs
node scripts/verify/apple/macos-bundle.mjs
node scripts/verify/apple/legacy-simulator.mjs
node scripts/verify/apple/dispatch.mjs
node scripts/verify/apple/interface-builder.mjs
- name: Run native Apple, iNES, and process boundary regressions
run: >-
npm run test:focused --
tests/acceptance/inesContainer.test.ts
tests/boundary/filesystem/inesArtifact.test.ts
tests/boundary/filesystem/inesCancellation.test.ts
- name: Run native Apple and process boundary regressions
run: >-
npm run test:focused --
tests/boundary/providers/hopper/hopperMacLaunchArguments.test.ts
tests/acceptance/providers/hopperStartupRecovery.test.ts
tests/boundary/providers/hopper/hopperClient.helperFailure.test.ts
@@ -922,16 +974,27 @@ jobs:
GOMAXPROCS: "2"
GOMEMLIMIT: "3GiB"
run: npm run typecheck -- --checkers 2
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
- name: Restore Windows Turbo build cache
id: windows-build-cache
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
name: rea-build-cache
path: .turbo/cache/
key: rea-windows-build-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.nvmrc', '.npmrc', 'package-lock.json') }}-${{ github.sha }}
restore-keys: rea-windows-build-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.nvmrc', '.npmrc', 'package-lock.json') }}-
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: windows-native-controls
path: native/windows/build/
- run: npm run verify:windows-native:artifact
- run: npm run build:cached
- name: Save validated Windows Turbo build cache
if: >-
success() && steps.npm-cache.outputs.can-save == 'true' &&
steps.windows-build-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: .turbo/cache/
key: ${{ steps.windows-build-cache.outputs.cache-primary-key }}
- name: Record named Windows host capabilities
run: node scripts/windows-capabilities.mjs | Out-File -Encoding utf8NoBOM windows-capabilities.json
- name: Validate Windows host capability report
@@ -1022,6 +1085,9 @@ jobs:
tests/process-global/runnerCancellation.test.ts
tests/process-global/windowsOwnedCommand.test.ts
tests/conformance/providers/ghidra/realGhidraWindowsWorkflow.test.ts
tests/boundary/filesystem/directoryArtifactReaderOpen.test.ts
tests/boundary/filesystem/javascriptPackagePrecedence.test.ts
tests/boundary/filesystem/javascriptArtifactContentIdentity.test.ts
- name: Verify real Node Inspector discovery and observation
timeout-minutes: 10
env:
@@ -1029,12 +1095,6 @@ jobs:
UV_THREADPOOL_SIZE: "2"
run: npm run verify:inspector
- run: npm run verify:package:windows
- name: Verify native directory identity on Node 24
run: >-
npx vitest run --coverage.enabled=false
tests/boundary/filesystem/directoryArtifactReaderOpen.test.ts
tests/boundary/filesystem/javascriptPackagePrecedence.test.ts
tests/boundary/filesystem/javascriptArtifactContentIdentity.test.ts
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22.23.4
@@ -1067,6 +1127,8 @@ jobs:
id: npm-cache
uses: ./.github/actions/npm-cache
- run: npm ci
- name: Reuse portable build outputs across runs
uses: ./.github/actions/portable-build-cache
- run: npm run docs:check
- name: Verify published routes, source links and local anchors
run: npm run verify:docs:routes
@@ -1202,6 +1264,16 @@ jobs:
build_cache_artifact: rea-build-cache
remote_cache_write: ${{ inputs.remote_cache_write == true || (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')) }}
go_binary:
needs: [changes, static, build]
if: needs.changes.outputs.go_binary == 'true'
secrets:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
uses: ./.github/workflows/real-go-binary.yml
with:
build_cache_artifact: rea-build-cache
remote_cache_write: ${{ inputs.remote_cache_write == true || (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')) }}
nativeaot:
needs: [changes, static]
if: needs.changes.outputs.nativeaot == 'true'
@@ -1212,6 +1284,11 @@ jobs:
if: needs.changes.outputs.ghidra_bridge == 'true'
uses: ./.github/workflows/ghidra-bridge-sources.yml
android_metadata:
needs: [changes, static]
if: needs.changes.outputs.android_metadata == 'true'
uses: ./.github/workflows/real-android-metadata.yml
website:
needs: [changes, static]
if: needs.changes.outputs.website == 'true'
@@ -1252,8 +1329,10 @@ jobs:
web_runtime,
web_source_map,
agentenv,
go_binary,
nativeaot,
ghidra_bridge,
android_metadata,
website,
]
runs-on: ubuntu-24.04
+51 -2
View File
@@ -3,8 +3,32 @@ name: CodeQL production
on:
push:
branches: [main]
paths-ignore:
- "tests/**"
- "scripts/fixtures/**"
- "**/*.test.*"
- "**/*.fixture.*"
- "**/test_*.py"
- "**/*_test.py"
- "**/*.md"
- "**/*.mermaid"
- "**/*.csv"
- "licenses/**"
- ".git-blame-ignore-revs"
pull_request:
branches: [main]
paths-ignore:
- "tests/**"
- "scripts/fixtures/**"
- "**/*.test.*"
- "**/*.fixture.*"
- "**/test_*.py"
- "**/*_test.py"
- "**/*.md"
- "**/*.mermaid"
- "**/*.csv"
- "licenses/**"
- ".git-blame-ignore-revs"
schedule:
- cron: "37 5 * * 1"
workflow_dispatch:
@@ -18,10 +42,35 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
scope:
# A repository administrator must disable default setup before enabling
# this workflow; default setup rejects advanced CodeQL result uploads.
if: vars.REA_CODEQL_ADVANCED == 'true'
name: Select production languages
runs-on: ubuntu-24.04
timeout-minutes: 5
outputs:
run: ${{ steps.scope.outputs.run }}
languages: ${{ steps.scope.outputs.languages }}
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 0 || 1 }}
filter: blob:none
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: .nvmrc
- name: Select CodeQL languages
id: scope
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: node scripts/ci/codeql-scope.mjs >> "$GITHUB_OUTPUT"
analyze:
needs: scope
if: vars.REA_CODEQL_ADVANCED == 'true' && needs.scope.outputs.run == 'true'
name: Analyze production (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 45
@@ -32,7 +81,7 @@ jobs:
fail-fast: false
max-parallel: 1
matrix:
language: [javascript-typescript, python, actions]
language: ${{ fromJSON(needs.scope.outputs.languages) }}
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
@@ -1,28 +1,12 @@
name: Real Android metadata bridge
on:
push:
branches: ["**"]
paths:
- .github/workflows/real-android-metadata.yml
- bridge/android/**
- src/android/JadxRelease.ts
- scripts/fixtures/android/**
- tests/conformance/android/**
- tests/fixtures/android/static-initializers/**
- tests/fixtures/android/direct-invokes/**
- tests/fixtures/android/external-invokes/**
- .nvmrc
workflow_dispatch:
workflow_call:
permissions:
contents: read
concurrency:
group: android-metadata-${{ github.ref }}
cancel-in-progress: true
jobs:
android-metadata:
runs-on: ubuntu-24.04
+25 -23
View File
@@ -1,38 +1,37 @@
name: Real Go binary metadata
on:
workflow_call:
inputs:
build_cache_artifact:
description: Portable build cache artifact from the calling CI run.
required: false
type: string
default: ""
remote_cache_write:
description: Trusted release qualification may publish the remote cache.
required: false
type: boolean
default: false
secrets:
TURBO_TOKEN:
description: Remote cache token. Only trusted callers pass it.
required: false
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/real-go-binary.yml"
- "src/go/**"
- "src/domain/go/**"
- "src/domain/dosMz.ts"
- "src/application/go/**"
- "src/contracts/go/**"
- "src/composition/go.ts"
- "src/cli/goCommands.ts"
- "src/server/contractToolBindings.ts"
- "src/server/serviceToolBindings.ts"
- "src/server/createServer.ts"
- "scripts/verify-go-binary.mjs"
- "scripts/lib/mcp-verifier-results.mjs"
permissions:
contents: read
concurrency:
group: real-go-binary-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
NODE_OPTIONS: --max-old-space-size=768
HUSKY: "0"
# Writes only on the default branch for push, schedule, manual dispatch,
# and workflow_call. Pull requests get an empty token and remote read-only mode.
TURBO_TOKEN: "${{ (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call')) && secrets.TURBO_TOKEN || '' }}"
# A called workflow sees the caller event, so workflow_call is not an event
# name here. Writes when remote_cache_write is set, or on the default branch
# for push, schedule, and manual dispatch. Open pull requests stay empty-token
# and use the local cache only.
TURBO_TOKEN: "${{ (inputs.remote_cache_write == true || (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'))) && secrets.TURBO_TOKEN || '' }}"
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_CACHE: "${{ (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call')) && 'local:rw,remote:rw' || 'local:rw,remote:r' }}"
TURBO_CACHE: "${{ (inputs.remote_cache_write == true || (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'))) && 'local:rw,remote:rw' || 'local:rw' }}"
jobs:
real-go-binary:
@@ -51,5 +50,8 @@ jobs:
go-version: "1.26.1"
cache: false
- run: npm ci
- uses: ./.github/actions/portable-build-cache
with:
build_cache_artifact: ${{ inputs.build_cache_artifact }}
- name: Verify compiler-produced ELF, PE and Mach-O through public CLI and MCP
run: npm run verify:go:binary