-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: Set up bencher * Check out correct branch * Use benchmark-action/github-action-benchmark * Disable benchmark-action/github-action-benchmark until it's on the allowlist * Enable? * Fix?
- Loading branch information
1 parent
2f039e3
commit 5264607
Showing
1 changed file
with
26 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
name: Bench | ||
on: | ||
workflow_run: | ||
workflows: ["CI"] | ||
workflows: [CI] | ||
types: [completed] | ||
env: | ||
CARGO_TERM_COLOR: always | ||
RUST_BACKTRACE: 1 | ||
TOOLCHAIN: nightly | ||
|
||
jobs: | ||
bench: | ||
|
@@ -16,8 +17,7 @@ jobs: | |
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
# components: rustfmt, clippy, llvm-tools-preview | ||
toolchain: $TOOLCHAIN | ||
|
||
- name: Use sccache | ||
uses: mozilla-actions/[email protected] | ||
|
@@ -27,17 +27,35 @@ jobs: | |
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV" | ||
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV" | ||
- name: Install dependencies (Linux) | ||
- name: Install dependencies | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
run: | | ||
sudo apt-get install -y --no-install-recommends gyp mercurial ninja-build lld | ||
sudo apt-get install -y --no-install-recommends gyp mercurial ninja-build lld python-is-python3 | ||
echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV" | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.workflow_run.head_branch }} | ||
|
||
- name: Build | ||
run: | | ||
cargo bench --features ci,bench | ||
- name: Benchmark | ||
run: cargo +$TOOLCHAIN bench --features ci,bench | tee output.txt | ||
|
||
- name: Download previous benchmark results | ||
uses: actions/cache@v4 | ||
with: | ||
path: ./cache | ||
key: ${{ runner.os }}-benchmark | ||
|
||
# - name: Store current benchmark results | ||
# uses: benchmark-action/github-action-benchmark@v1 | ||
# with: | ||
# tool: 'cargo' | ||
# output-file-path: output.txt | ||
# external-data-json-path: ./cache/benchmark-data.json | ||
# fail-on-alert: true | ||
# github-token: ${{ secrets.GITHUB_TOKEN }} | ||
# comment-on-alert: true | ||
# summary-always: true | ||
|