Benchmark #8601
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Benchmark | |
on: | |
schedule: | |
# run once per hr (minute chosen by fair dice roll but not full hr) | |
- cron: '18 * * * *' | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
bencher: | |
if: "! (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)" | |
runs-on: ubuntu-latest | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
BENCHER_PROJECT: laze | |
BENCHER_TESTBED: github-actions | |
BENCHER_ADAPTER: json | |
steps: | |
- name: check out repository code | |
uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
- name: rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Run sccache-cache | |
uses: mozilla-actions/sccache-action@v0.0.3 | |
- name: "Configure git" | |
run: | | |
git config --global init.defaultBranch main | |
git config --global user.email "ci@riot-labs.de" | |
git config --global user.name "CI" | |
- uses: bencherdev/bencher@main | |
- name: "Build & install" | |
run: "cargo install --path ." | |
- name: "Open up perf" | |
run: sudo sysctl -w kernel.perf_event_paranoid=-1 | |
- name: clone RIOT | |
run: > | |
git clone --depth 1 https://github.com/kaspar030/RIOT -b add_laze_buildfiles_bencher | |
- name: "Run benchmark" | |
run: perf stat -j -o perf-stat.json -- laze -C RIOT build --global -G | |
- name: "Convert results" | |
run: ci/perf2bencher.rs perf-stat.json "laze -C RIOT build --global --generate-only" > bencher.json | |
- name: Submit results to Bencher (main) | |
if: github.event_name != 'pull_request' | |
run: > | |
bencher run | |
--token "${{ secrets.BENCHER_API_TOKEN }}" | |
--branch "$GITHUB_REF_NAME" | |
--hash "$GITHUB_SHA" | |
--threshold-measure perf-task-clock | |
--threshold-test t_test | |
--threshold-max-sample-size 64 | |
--threshold-upper-boundary 0.99 | |
--thresholds-reset | |
--err | |
--file bencher.json | |
- name: Submit results to Bencher (PR) | |
if: github.event_name == 'pull_request' | |
run: > | |
bencher run | |
--token "${{ secrets.BENCHER_API_TOKEN }}" | |
--branch "$GITHUB_REF_NAME" | |
--hash "$GITHUB_SHA" | |
--github-actions "${{ secrets.GITHUB_TOKEN }}" | |
--ci-public-links | |
--ci-number "${{ github.event.pull_request.number }}" | |
--start-point "${{ github.base_ref }}" | |
--start-point-hash "${{ github.event.pull_request.base.sha }}" | |
--start-point-clone-thresholds | |
--start-point-reset | |
--err | |
--file bencher.json |