util: support config files in parallel_sim.sh #71
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |