Skip to content

Commit

Permalink
Merge pull request #1255 from GitGab19/update-bencher-workflow
Browse files Browse the repository at this point in the history
Update CI benchmarks workflows
  • Loading branch information
GitGab19 authored Nov 18, 2024
2 parents b900d0a + c54af5e commit 8c98647
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 50 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/fork_pr_benchmark_closed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
pull_request_target:
types: [closed]

jobs:
archive_fork_pr_branch:
name: Archive closed fork PR branch with Bencher
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: bencherdev/bencher@main
- name: Archive closed fork PR branch with Bencher
run: |
bencher archive \
--project stratum-v2-sri \
--token '${{ secrets.BENCHER_API_TOKEN }}' \
--branch "$GITHUB_HEAD_REF"
104 changes: 54 additions & 50 deletions .github/workflows/run-and-track-benchmarks-on-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,120 +5,124 @@ on:
branches:
- main

permissions:
checks: write

jobs:
benchmark_sv1_criterion_with_bencher:
name: Track sv1 criterion benchmarks with Bencher
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: stratum-v2-sri
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_criterion
BENCHER_TESTBED: sv1
BENCHER_PROJECT: stratum-v2-sri
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_criterion
BENCHER_TESTBED: sv1
steps:
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
override: true

- name: Checkout repository
uses: actions/checkout@v2

- uses: actions/checkout@v4
uses: actions/checkout@v4

- uses: bencherdev/bencher@main
- name: Benchmark with Bencher
run: |
cd benches
bencher run \
--github-actions ${{ secrets.GITHUB_TOKEN }} \
"cargo bench --bench criterion_sv1_benchmark"
cd benches
bencher run \
--github-actions ${{ secrets.GITHUB_TOKEN }} \
"cargo bench --bench criterion_sv1_benchmark"
benchmark_sv2_criterion_with_bencher:
name: Track sv2 criterion benchmarks with Bencher
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: stratum-v2-sri
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_criterion
BENCHER_TESTBED: sv2
BENCHER_PROJECT: stratum-v2-sri
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_criterion
BENCHER_TESTBED: sv2
steps:
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
override: true

- name: Checkout repository
uses: actions/checkout@v2

- uses: actions/checkout@v4
uses: actions/checkout@v4

- uses: bencherdev/bencher@main
- name: Benchmark with Bencher
run: |
cd benches
bencher run \
--github-actions ${{ secrets.GITHUB_TOKEN }} \
"cargo bench --bench criterion_sv2_benchmark"
cd benches
bencher run \
--github-actions ${{ secrets.GITHUB_TOKEN }} \
"cargo bench --bench criterion_sv2_benchmark"
benchmark_sv1_iai_with_bencher:
name: Track sv1 iai benchmarks with Bencher
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: stratum-v2-sri
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_iai
BENCHER_TESTBED: sv1
BENCHER_PROJECT: stratum-v2-sri
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_iai
BENCHER_TESTBED: sv1
steps:
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
override: true

- name: Checkout repository
uses: actions/checkout@v4

- name: Install Valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind=1:3.18.1-1ubuntu2
- uses: actions/checkout@v4
sudo apt-get update
sudo apt-get install -y valgrind=1:3.18.1-1ubuntu2
- uses: bencherdev/bencher@main
- name: Benchmark with Bencher
run: |
cd benches
bencher run \
--github-actions ${{ secrets.GITHUB_TOKEN }} \
"cargo bench --bench iai_sv1_benchmark"
cd benches
bencher run \
--github-actions ${{ secrets.GITHUB_TOKEN }} \
"cargo bench --bench iai_sv1_benchmark"
benchmark_sv2_iai_with_bencher:
name: Track sv2 iai benchmarks with Bencher
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: stratum-v2-sri
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_iai
BENCHER_TESTBED: sv2
BENCHER_PROJECT: stratum-v2-sri
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_iai
BENCHER_TESTBED: sv2
steps:
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
override: true

- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind=1:3.18.1-1ubuntu2
- uses: actions/checkout@v4
sudo apt-get update
sudo apt-get install -y valgrind=1:3.18.1-1ubuntu2
- uses: bencherdev/bencher@main
- name: Benchmark with Bencher
run: |
cd benches
bencher run \
--github-actions ${{ secrets.GITHUB_TOKEN }} \
"cargo bench --bench iai_sv2_benchmark"
cd benches
bencher run \
--github-actions ${{ secrets.GITHUB_TOKEN }} \
"cargo bench --bench iai_sv2_benchmark"

0 comments on commit 8c98647

Please sign in to comment.