-
Notifications
You must be signed in to change notification settings - Fork 220
60 lines (55 loc) · 1.83 KB
/
benchmark.yml
File metadata and controls
60 lines (55 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Benchmark
on:
workflow_dispatch:
schedule:
- cron: '0 10 * * *' # Run at 10:00 UTC every day
jobs:
has-new-commit:
name: Has New Commit? # Check if there are new commits in the last 24 hours
runs-on: ubuntu-latest
steps:
- name: Checkout default branch
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Exit early if no new commits
id: check-commits
run: |
count=$(git log --oneline --since '24 hours ago' | wc -l)
if [ "$count" -eq 0 ]; then
echo "No new commits found in the last 24 hours"
exit 1
fi
publish:
name: Publish
needs: has-new-commit # Only run if there are new commits
runs-on: ubuntu-latest-8
timeout-minutes: 720
strategy:
max-parallel: 1 # Run one package at a time
matrix:
include:
- package: commonware-cryptography
- package: commonware-storage
- package: commonware-stream
steps:
- uses: actions/checkout@v4
- name: Install nightly Rust toolchain
run: rustup toolchain install nightly
- name: Run setup
uses: ./.github/actions/setup
- name: Compile benchmarks
run: cargo bench --no-run
- name: Run benchmark
run: cargo bench --benches -p ${{ matrix.package }} -- --output-format bencher | tee ${{ matrix.package }}.txt
- name: Publish benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: ${{ matrix.package }}
tool: 'cargo'
output-file-path: ${{ matrix.package }}.txt
github-token: ${{ secrets.BENCHMARKS_SECRET }}
gh-repository: github.com/commonwarexyz/benchmarks
gh-pages-branch: main
benchmark-data-dir-path: 'docs'
auto-push: true