Skip to content

Use (void) for empty parameter lists #3454

Use (void) for empty parameter lists

Use (void) for empty parameter lists #3454

Workflow file for this run

name: Benchmark
on: [push, pull_request_target, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event.pull_request.head.sha || github.sha }}
cancel-in-progress: true
# github-action-benchmark authenticates with RV32EMU_BENCH_TOKEN for both the
# gh-pages push and the PR comment, so GITHUB_TOKEN needs nothing beyond read.
# This workflow runs on pull_request_target, where the default write-all token
# would be in scope for fork-triggered runs.
permissions:
contents: read
jobs:
# Resolved in its own job so the benchmark carries a single condition rather
# than repeating it on every step.
detect-file-changes:
if: contains(toJSON(github.event.head_commit.message), 'Merge pull request ') == false
runs-on: ubuntu-24.04
outputs:
has_changed_files: ${{ steps.changed-files.outputs.any_changed }}
steps:
- uses: actions/checkout@v7
- name: Test changed files
id: changed-files
uses: tj-actions/changed-files@v47
with:
files: |
src/riscv.c
src/decode.c
src/emulate.c
src/rv32_template.c
src/rv32_constopt.c
src/cache.c
src/io.c
src/jit.c
# Build system configuration (may affect optimization flags)
mk/kconfig.mk
mk/toolchain.mk
tools/detect-env.py
benchmark:
name: Performance regression check
needs: [detect-file-changes]
if: needs.detect-file-changes.outputs.has_changed_files == 'true' || github.event_name == 'workflow_dispatch'
timeout-minutes: 30
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
submodules: 'true'
- name: Cache benchmark artifacts
uses: actions/cache@v6
with:
path: build/
key: benchmark-artifacts-${{ runner.os }}-${{ hashFiles('mk/artifact.mk') }}
restore-keys: |
benchmark-artifacts-${{ runner.os }}-
- name: Install dependencies
run: sudo pip3 install numpy --break-system-packages
- name: Build for benchmark
# GH_TOKEN raises the anonymous-API rate limit (60 req/hr) so the
# parse-time call to fetch-releases-tag stops flaking when the
# cache misses and several PRs build back-to-back.
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make defconfig && make ENABLE_SDL=0 all artifact
- name: Run benchmark
run: python3 tests/bench.py --json --quiet
- name: Store benchmark results
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: .