forked from MiniMax-AI/minimax-code
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (100 loc) · 4.45 KB
/
Copy pathperformance.yml
File metadata and controls
100 lines (100 loc) · 4.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Performance
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
workflow_dispatch:
inputs:
base:
description: Baseline commit or branch
required: true
default: main
type: string
suite:
description: Performance suite (full includes startup and long history)
required: true
default: full
type: choice
options: [full, basic]
permissions:
contents: read
jobs:
performance:
# Unrelated label events must not replace the actual performance check.
name: ${{ contains(fromJSON('["labeled","unlabeled"]'), github.event.action) && github.event.label.name != 'perf:full' && 'performance (label ignored)' || 'performance' }}
if: ${{ !contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || github.event.label.name == 'perf:full' }}
strategy:
matrix:
suite: ${{ fromJSON((inputs.suite == 'full' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'perf:full'))) && '["full"]' || '["basic"]') }}
concurrency:
group: performance-${{ github.event_name }}-${{ github.ref }}-${{ github.event_name == 'workflow_dispatch' && matrix.suite || 'auto' }}
cancel-in-progress: true
runs-on: macos-15
timeout-minutes: ${{ matrix.suite == 'full' && 45 || 15 }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
path: candidate
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
path: baseline
ref: ${{ github.event.pull_request.base.sha || inputs.base }}
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: KonghaYao/harness-perf-benchmark
ref: 8ad1e09f7653d7e97b83b4f5b4d347ca2fa129c7
path: benchmark
persist-credentials: false
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
with:
version: 9.12.0
package_json_file: candidate/package.json
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22.23.2
package-manager-cache: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.4.2
- name: Build baseline
working-directory: baseline
run: |
pnpm install --frozen-lockfile
pnpm build
- name: Build candidate
working-directory: candidate
run: |
pnpm install --frozen-lockfile
pnpm build
- name: Install pinned benchmark
working-directory: benchmark
run: bun install --frozen-lockfile
- name: Compare on this runner
env:
PERF_SUITE: ${{ matrix.suite }}
# Exit 2 means INCONCLUSIVE: persistent runner noise, no confirmed
# regression. Basic runs warn without blocking unrelated changes;
# full runs still fail because performance work requires a real PASS.
run: |
status=0
node candidate/scripts/perf/run.mjs --base baseline --head candidate --benchmark benchmark --suite "$PERF_SUITE" --out "$RUNNER_TEMP/performance" || status=$?
if [ "$status" -eq 2 ]; then
if [ "$PERF_SUITE" = "full" ]; then
echo "::error title=Full performance check inconclusive::The full suite stayed too noisy to conclude after confirmation pairs. Performance changes require a real PASS; see the job summary and artifact, then rerun."
exit 2
fi
echo "::warning title=Performance check inconclusive::Runner noise exceeded stability limits even after confirmation pairs; no regression was confirmed. This is not evidence of a pass; see the job summary and artifact before relying on performance results."
exit 0
fi
exit "$status"
- name: Upload performance evidence
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: performance-${{ matrix.suite }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/performance/
include-hidden-files: true
retention-days: 14
if-no-files-found: warn