Skip to content

Commit 202fb65

Browse files
committed
Move benchmark run to main.yml file
Hotfix 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 742e113 commit 202fb65

File tree

2 files changed

+61
-18
lines changed

2 files changed

+61
-18
lines changed

.github/workflows/benchmark.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
benchmark:
77
name: Performance regression check
88
if: contains(toJSON(github.event.head_commit.message), 'Merge pull request ') == false
9-
runs-on: ubuntu-22.04
9+
runs-on: ubuntu-24.04
1010
steps:
1111
- uses: actions/checkout@v4
1212
- name: Test changed files
@@ -23,28 +23,28 @@ jobs:
2323
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
2424
github.event_name == 'workflow_dispatch'}}
2525
run: |
26-
sudo pip3 install numpy
26+
sudo pip3 install numpy --break-system-packages
2727
shell: bash
2828
- name: default build
2929
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
3030
github.event_name == 'workflow_dispatch'}}
31-
run: make
31+
run: make ENABLE_SDL=0
3232
- name: Run benchmark
3333
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
3434
github.event_name == 'workflow_dispatch'}}
3535
run: |
3636
tests/bench-aggregator.py
37-
- name: Store benchmark results
38-
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
39-
github.event_name == 'workflow_dispatch'}}
40-
uses: benchmark-action/github-action-benchmark@v1
41-
with:
42-
name: Benchmarks
43-
tool: 'customBiggerIsBetter'
44-
output-file-path: benchmark_output.json
45-
github-token: ${{ secrets.RV32EMU_BENCH_TOKEN }}
46-
gh-repository: 'github.com/sysprog21/rv32emu-bench'
47-
gh-pages-branch: 'master'
48-
auto-push: true
49-
comment-always: true
50-
benchmark-data-dir-path: .
37+
# - name: Store benchmark results
38+
# if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
39+
# github.event_name == 'workflow_dispatch'}}
40+
# uses: benchmark-action/github-action-benchmark@v1
41+
# with:
42+
# name: Benchmarks
43+
# tool: 'customBiggerIsBetter'
44+
# output-file-path: benchmark_output.json
45+
# github-token: ${{ secrets.RV32EMU_BENCH_TOKEN }}
46+
# gh-repository: 'github.com/sysprog21/rv32emu-bench'
47+
# gh-pages-branch: 'master'
48+
# auto-push: true
49+
# comment-always: true
50+
# benchmark-data-dir-path: .

.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)