Skip to content

[WIP] Benchmark

[WIP] Benchmark #31

Workflow file for this run

name: Benchmark
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
benchmark:
name: Run benchmark
runs-on: ubuntu-latest
permissions:
pull-requests: write # in order to add a comment to PR
steps:
- name: Checkout libstapsdt repo
uses: actions/checkout@v4
with:
repository: linux-usdt/libstapsdt
ref: refs/heads/main
path: ext_libstapsdt
- name: Install libstapsdt
run: |
set -euxo pipefail
sudo apt install libelf-dev
cd ext_libstapsdt
make
sudo make install
sudo ldconfig
shell: bash
- name: Checkout DynamicProbes repo
uses: actions/checkout@v4
- name: Install dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.401'
- name: Run benchmark
run: cd benchmark && dotnet run --exporters json --filter '*' -c Release
- uses: actions/upload-artifact@v4
with:
name: results
path: benchmark/BenchmarkDotNet.Artifacts/results/
# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: last-benchmark
# - name: PR comment with file
# uses: thollander/actions-comment-pull-request@v2
# with:
# filePath: benchmark/BenchmarkDotNet.Artifacts/results/Benchmark.NotObservedProbeFireBenchmarks-report-github.md
- name: Publish benchmark result
uses: gukoff/github-action-benchmark@short-floats
with:
name: Benchmark (compared to main)
tool: 'benchmarkdotnet'
output-file-path: benchmark/BenchmarkDotNet.Artifacts/results/Benchmark.NotObservedProbeFireBenchmarks-report-full-compressed.json
external-data-json-path: ./cache/benchmark-data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
summary-always: true
comment-always: true
# Caveat: https://github.com/benchmark-action/github-action-benchmark?tab=readme-ov-file#caveats
# When triggering on PRs, it's important to have this action "read-only"
save-data-file: ${{ github.event_name != 'pull_request' }}
alert-threshold: '200%'
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: '@gukoff'