File tree Expand file tree Collapse file tree 2 files changed +49
-13
lines changed Expand file tree Collapse file tree 2 files changed +49
-13
lines changed Original file line number Diff line number Diff line change 1010
1111permissions :
1212 contents : read
13- pull-requests : write
1413
1514jobs :
1615 checks :
@@ -93,23 +92,15 @@ jobs:
9392 fail_ci_if_error : true
9493
9594 - name : Install benchmarking tools
96- if : ${{ startsWith(matrix.os, 'ubuntu-') }}
95+ if : ${{ github.ref == 'refs/heads/main' && startsWith(matrix.os, 'ubuntu-') }}
9796 uses : bencherdev/bencher@main
9897
9998 - name : Run benchmarks
100- if : ${{ startsWith(matrix.os, 'ubuntu-') }}
99+ if : ${{ github.ref == 'refs/heads/main' && startsWith(matrix.os, 'ubuntu-') }}
101100 env :
102101 BENCHER_API_TOKEN : ${{ secrets.BENCHER_API_TOKEN }}
103102 BENCHER_PROJECT : theseus-rs-postgresql-embedded
104103 BENCHER_ADAPTER : rust_criterion
105104 run : |
106- cargo bench --bench archive --features blocking -- --output-format criterion | \
107- bencher run \
108- --ci-number "${{ github.event.number }}" \
109- --github-actions "${{ secrets.GITHUB_TOKEN }}" \
110- --err
111- cargo bench --bench embedded --features blocking -- --output-format criterion | \
112- bencher run \
113- --ci-number "${{ github.event.number }}" \
114- --github-actions "${{ secrets.GITHUB_TOKEN }}" \
115- --err
105+ cargo bench --bench archive --features blocking -- --output-format criterion | bencher run
106+ cargo bench --bench embedded --features blocking -- --output-format criterion | bencher run
Original file line number Diff line number Diff line change 1+ name : Run and Cache Benchmarks
2+
3+ on :
4+ pull_request :
5+ types : [opened, reopened, synchronize]
6+
7+ permissions :
8+ pull-requests : write
9+
10+ jobs :
11+ benchmark :
12+ name : Run Benchmarks
13+ runs-on : ubuntu-22.04
14+ steps :
15+ - name : Checkout source code
16+ uses : actions/checkout@v4
17+
18+ - name : Install Rust
19+ uses : dtolnay/rust-toolchain@master
20+ with :
21+ components : ' llvm-tools-preview'
22+ toolchain : stable
23+
24+ - name : Enable caching
25+ uses : Swatinem/rust-cache@v2
26+
27+ - name : Install benchmarking tools
28+ uses : bencherdev/bencher@main
29+
30+ - name : Run benchmarks
31+ env :
32+ BENCHER_API_TOKEN : ${{ secrets.BENCHER_API_TOKEN }}
33+ BENCHER_PROJECT : theseus-rs-postgresql-embedded
34+ BENCHER_ADAPTER : rust_criterion
35+ run : |
36+ cargo bench --bench archive --features blocking -- --output-format criterion | \
37+ bencher run \
38+ --ci-number "${{ github.event.number }}" \
39+ --github-actions "${{ secrets.GITHUB_TOKEN }}" \
40+ --err
41+ cargo bench --bench embedded --features blocking -- --output-format criterion | \
42+ bencher run \
43+ --ci-number "${{ github.event.number }}" \
44+ --github-actions "${{ secrets.GITHUB_TOKEN }}" \
45+ --err
You can’t perform that action at this time.
0 commit comments