Skip to content

Commit

Permalink
CI: Reintroduce benchmark.yml (sysprog21#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
henrybear327 authored Jul 10, 2024
1 parent a2e3aaa commit 9759ad2
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 44 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Benchmark

on: [push, pull_request_target, workflow_dispatch]

jobs:
benchmark:
name: Performance regression check
if: contains(toJSON(github.event.head_commit.message), 'Merge pull request ') == false
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: .
45 changes: 1 addition & 44 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,8 @@
name: CI

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

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

0 comments on commit 9759ad2

Please sign in to comment.