-
Notifications
You must be signed in to change notification settings - Fork 72
89 lines (78 loc) · 2.81 KB
/
on-demand-spec.yml
File metadata and controls
89 lines (78 loc) · 2.81 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
name: On-Demand SPEC Test (Tier 1.5)
on:
# Label触发: 添加 'perf' 标签自动跑 spec06-0.8c
pull_request_target:
types: [labeled]
# 手动触发: 可选择PR和benchmark类型
workflow_dispatch:
inputs:
pr_number:
description: 'PR number'
required: true
type: number
benchmark_type:
description: 'Benchmark type'
required: false
type: choice
default: 'spec06-0.8c'
options:
- spec06-0.8c
- spec06-1.0c
- spec17-1.0c
- spec06-rvv-1.0c
- spec06int-rvv-0.8c
jobs:
trigger:
name: Trigger SPEC Test
runs-on: ubuntu-latest
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request_target' &&
github.event.label.name == 'perf' &&
github.event.pull_request.base.ref == 'xs-dev')
outputs:
benchmark_type: ${{ steps.setup.outputs.benchmark }}
vector_type: ${{ steps.setup.outputs.vector_type }}
pr_sha: ${{ steps.setup.outputs.pr_sha }}
steps:
- name: Setup parameters
id: setup
uses: actions/github-script@v7
with:
script: |
let prNumber, benchmark, prSha;
if (context.eventName === 'workflow_dispatch') {
// 手动触发
prNumber = context.payload.inputs.pr_number;
benchmark = context.payload.inputs.benchmark_type;
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
});
prSha = pr.data.head.sha;
} else {
// Label触发 (pull_request_target)
prNumber = context.payload.pull_request.number;
benchmark = 'spec06-0.8c';
prSha = context.payload.pull_request.head.sha;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: '🚀 Performance test triggered: **spec06-0.8c**'
});
}
const vectorType = benchmark.includes('rvv') ? 'simple' : '';
core.setOutput('benchmark', benchmark);
core.setOutput('vector_type', vectorType);
core.setOutput('pr_sha', prSha);
run_spec_test:
name: Run SPEC Test
needs: trigger
uses: ./.github/workflows/gem5-perf-template.yml
with:
config_path: configs/example/idealkmhv3.py
benchmark_type: ${{ needs.trigger.outputs.benchmark_type }}
vector_type: ${{ needs.trigger.outputs.vector_type }}
pr_sha: ${{ needs.trigger.outputs.pr_sha }}