Skip to content

Commit 0e13f01

Browse files
committed
Move benchmark run to main.yml file
This commit also fixes pip3 install error: externally-managed-environment Reference: - https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3 Signed-off-by: Chun-Hung Tseng <[email protected]>
1 parent 2ee375b commit 0e13f01

File tree

2 files changed

+44
-51
lines changed

2 files changed

+44
-51
lines changed

.github/workflows/benchmark.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,51 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on: [push, pull_request, workflow_dispatch]
44

55
jobs:
6+
benchmark:
7+
runs-on: ubuntu-24.04
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Test changed files
11+
id: changed-files
12+
uses: tj-actions/changed-files@v44
13+
with:
14+
files: |
15+
src/riscv.c
16+
src/decode.c
17+
src/emulate.c
18+
src/rv32_template.c
19+
src/rv32_constopt.c
20+
- name: install-dependencies
21+
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
22+
github.event_name == 'workflow_dispatch'}}
23+
run: |
24+
sudo pip3 install numpy --break-system-packages
25+
shell: bash
26+
- name: default build
27+
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
28+
github.event_name == 'workflow_dispatch'}}
29+
run: make ENABLE_SDL=0
30+
- name: Run benchmark
31+
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
32+
github.event_name == 'workflow_dispatch'}}
33+
run: |
34+
tests/bench-aggregator.py
35+
- name: Store benchmark results
36+
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
37+
github.event_name == 'workflow_dispatch'}}
38+
uses: benchmark-action/github-action-benchmark@v1
39+
with:
40+
name: Benchmarks
41+
tool: 'customBiggerIsBetter'
42+
output-file-path: benchmark_output.json
43+
github-token: ${{ secrets.RV32EMU_BENCH_TOKEN }}
44+
gh-repository: 'github.com/sysprog21/rv32emu-bench'
45+
gh-pages-branch: 'master'
46+
auto-push: true
47+
comment-always: true
48+
benchmark-data-dir-path: .
649
detect-code-related-file-changes:
750
runs-on: ubuntu-22.04
851
outputs:

0 commit comments

Comments
 (0)