Skip to content

Commit

Permalink
Merge pull request #460 from henrybear327/ci/fix_benchmark_pipeline
Browse files Browse the repository at this point in the history
Fix benchmark CI pipeline
  • Loading branch information
jserv authored Jul 10, 2024
2 parents 9f5c057 + 0e13f01 commit a2e3aaa
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 53 deletions.
50 changes: 0 additions & 50 deletions .github/workflows/benchmark.yml

This file was deleted.

45 changes: 44 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,51 @@
name: CI

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

jobs:
benchmark:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Test changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
src/riscv.c
src/decode.c
src/emulate.c
src/rv32_template.c
src/rv32_constopt.c
- name: install-dependencies
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch'}}
run: |
sudo pip3 install numpy --break-system-packages
shell: bash
- name: default build
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch'}}
run: make ENABLE_SDL=0
- name: Run benchmark
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch'}}
run: |
tests/bench-aggregator.py
- name: Store benchmark results
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch'}}
uses: benchmark-action/github-action-benchmark@v1
with:
name: Benchmarks
tool: 'customBiggerIsBetter'
output-file-path: benchmark_output.json
github-token: ${{ secrets.RV32EMU_BENCH_TOKEN }}
gh-repository: 'github.com/sysprog21/rv32emu-bench'
gh-pages-branch: 'master'
auto-push: true
comment-always: true
benchmark-data-dir-path: .
detect-code-related-file-changes:
runs-on: ubuntu-22.04
outputs:
Expand Down
Binary file modified build/coremark.elf
Binary file not shown.
Binary file modified build/dhrystone.elf
100644 → 100755
Binary file not shown.
5 changes: 3 additions & 2 deletions tests/coremark.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
import json

iter = 10
coremark_param = "0x0 0x0 0x66 30000 7 1 2000"
res = []
file_exist = os.path.exists('build/rv32emu')
if not file_exist:
print("Please compile before running test")
exit(1)
print("Start Test CoreMark benchmark")
comp_proc = subprocess.check_output(
'build/rv32emu build/coremark.elf', shell=True).decode("utf-8")
"build/rv32emu build/coremark.elf {}".format(coremark_param), shell=True).decode("utf-8")
if not comp_proc or comp_proc.find("Error") != -1:
print("Test Error")
exit(1)
Expand All @@ -23,7 +24,7 @@
for i in range(iter):
print("Running CoreMark benchmark - Run #{}".format(i + 1))
comp_proc = subprocess.check_output(
'build/rv32emu build/coremark.elf', shell=True).decode("utf-8")
"build/rv32emu build/coremark.elf {}".format(coremark_param), shell=True).decode("utf-8")
if not comp_proc:
print("Fail\n")
exit(1)
Expand Down

0 comments on commit a2e3aaa

Please sign in to comment.