mirror of
https://github.com/samuelncui/yatm.git
synced 2026-11-08 04:18:03 +00:00
Keep fixed planner inputs, quality references, resource cases and the Go scenario benchmarks together with the performance collector tiers, so route quality and planning time remain comparable across changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
144 lines
5.0 KiB
YAML
144 lines
5.0 KiB
YAML
name: Performance
|
|
|
|
on:
|
|
pull_request:
|
|
workflow_call:
|
|
inputs:
|
|
candidate:
|
|
description: Full candidate commit SHA
|
|
required: true
|
|
type: string
|
|
tier:
|
|
description: Performance profile compared with the accepted source baseline
|
|
default: release
|
|
type: string
|
|
workflow_dispatch:
|
|
inputs:
|
|
candidate:
|
|
description: Full candidate commit SHA
|
|
required: true
|
|
type: string
|
|
tier:
|
|
description: Compare with the explicitly accepted source baseline
|
|
required: true
|
|
default: release
|
|
type: choice
|
|
options:
|
|
- critical
|
|
- release
|
|
- read-fast
|
|
- read
|
|
- read-resources
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: performance-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
paired:
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 240
|
|
steps:
|
|
# PR code is measured, but the base revision owns the checker and common harness.
|
|
- name: Check out reviewed tools and harness
|
|
uses: actions/checkout@v7
|
|
with:
|
|
ref: ${{ github.event.pull_request.base.sha || github.sha }}
|
|
path: tools
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@v7
|
|
with:
|
|
node-version: '24'
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
package_json_file: tools/frontend/package.json
|
|
- id: sources
|
|
name: Resolve immutable comparison sources
|
|
working-directory: tools
|
|
env:
|
|
PERFORMANCE_ACCEPTED_BASELINE: ${{ vars.PERFORMANCE_ACCEPTED_BASELINE }}
|
|
PERF_CANDIDATE: ${{ inputs.candidate }}
|
|
PERF_TIER: ${{ inputs.tier }}
|
|
run: node dev/performance/ci.mjs
|
|
- name: Check out baseline
|
|
uses: actions/checkout@v7
|
|
with:
|
|
ref: ${{ steps.sources.outputs.baseline }}
|
|
path: baseline
|
|
persist-credentials: false
|
|
- name: Check out candidate
|
|
uses: actions/checkout@v7
|
|
with:
|
|
ref: ${{ steps.sources.outputs.candidate }}
|
|
path: candidate
|
|
persist-credentials: false
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: tools/go.mod
|
|
cache-dependency-path: |
|
|
baseline/go.sum
|
|
candidate/go.sum
|
|
- name: Check collection and gate tooling
|
|
working-directory: tools
|
|
run: make test-performance-tools
|
|
- id: read-scope
|
|
name: Check whether Restore planning inputs changed
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
working-directory: tools
|
|
run: node dev/performance/ci.mjs read-affected "$GITHUB_WORKSPACE/baseline" "$GITHUB_WORKSPACE/candidate"
|
|
- name: Collect paired measurements
|
|
working-directory: tools
|
|
env:
|
|
PERF_TIER: ${{ steps.sources.outputs.tier }}
|
|
run: >-
|
|
node dev/performance/collect.mjs
|
|
--baseline "$GITHUB_WORKSPACE/baseline"
|
|
--candidate "$GITHUB_WORKSPACE/candidate"
|
|
--harness "$GITHUB_WORKSPACE/tools"
|
|
--out "$RUNNER_TEMP/performance-pair"
|
|
--tier "$PERF_TIER"
|
|
--environment "github-ubuntu-24.04"
|
|
--idle
|
|
- name: Compare benchmark values and flag regressions
|
|
working-directory: tools
|
|
run: node dev/check-performance.mjs "$RUNNER_TEMP/performance-pair"
|
|
- name: Collect affected Restore planning comparison
|
|
if: ${{ steps.read-scope.outputs.read == 'true' }}
|
|
working-directory: tools
|
|
run: >-
|
|
node dev/performance/collect.mjs
|
|
--baseline "$GITHUB_WORKSPACE/baseline"
|
|
--candidate "$GITHUB_WORKSPACE/candidate"
|
|
--harness "$GITHUB_WORKSPACE/tools"
|
|
--out "$RUNNER_TEMP/read-performance-pair"
|
|
--tier read-fast
|
|
--environment "github-ubuntu-24.04"
|
|
--idle
|
|
- name: Compare affected Restore routes and resources
|
|
if: ${{ steps.read-scope.outputs.read == 'true' }}
|
|
working-directory: tools
|
|
run: node dev/check-performance.mjs "$RUNNER_TEMP/read-performance-pair"
|
|
- name: Compare frontend directory and Job result benchmarks
|
|
if: ${{ !startsWith(steps.sources.outputs.tier, 'read') }}
|
|
working-directory: tools
|
|
run: >-
|
|
node frontend/scripts/compare-performance.mjs
|
|
--baseline "$GITHUB_WORKSPACE/baseline"
|
|
--candidate "$GITHUB_WORKSPACE/candidate"
|
|
--harness "$GITHUB_WORKSPACE/tools"
|
|
--out "$RUNNER_TEMP/frontend-performance-pair"
|
|
- name: Retain measurements and comparability evidence
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: performance-${{ github.run_id }}-${{ github.run_attempt }}
|
|
path: |
|
|
${{ runner.temp }}/performance-pair/
|
|
${{ runner.temp }}/frontend-performance-pair/
|
|
${{ runner.temp }}/read-performance-pair/
|
|
if-no-files-found: warn
|
|
retention-days: 30
|