Skip to content

Commit 749a335

Browse files
committed
Update pr_criterion.yaml: use bare-metal runners
1 parent 5be79c7 commit 749a335

File tree

2 files changed

+59
-31
lines changed

2 files changed

+59
-31
lines changed

.github/workflows/benchmark.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This workflow runs a Criterion benchmark on a PR and compares the results against the base branch.
2+
# It is triggered on a PR or a push to main.
3+
#
4+
# The workflow is gated on the presence of the "performance" label on the PR.
5+
#
6+
# The workflow runs on a self-hosted runner pool. We can't use the shared runners for this,
7+
# because they are only permitted to run on the default branch to preserve resources.
8+
#
9+
# In the future, we might like to consider using bencher.dev or the framework used by otel-golang here.
10+
on:
11+
pull_request:
12+
push:
13+
branches:
14+
- main
15+
name: benchmark pull requests
16+
jobs:
17+
runBenchmark:
18+
name: run benchmark
19+
permissions:
20+
pull-requests: write
21+
22+
# If we're running on a PR, use ubuntu-latest - a shared runner. We can't use the self-hosted
23+
# runners on arbitrary PRs, and we don't want to unleash that load on the pool anyway.
24+
# If we're running on main, use the OTEL self-hosted runner pool.
25+
runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-latest' || 'self-hosted' }}
26+
if: |
27+
${{
28+
github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'performance') ||
29+
github.event_name == 'push'
30+
}}
31+
env:
32+
# For PRs, compare against the base branch
33+
# For pushes to main, compare against the previous commit
34+
#BRANCH_NAME: ${{ github.event_name == 'pull_request' && github.base_ref || github.event.before }}
35+
BRANCH_NAME: ${{ github.event.before }}
36+
steps:
37+
- uses: actions/checkout@v4
38+
with:
39+
fetch-depth: 10 # Fetch current commit and its parent
40+
- uses: arduino/setup-protoc@v3
41+
with:
42+
repo-token: ${{ secrets.GITHUB_TOKEN }}
43+
- uses: dtolnay/rust-toolchain@master
44+
with:
45+
toolchain: stable
46+
- uses: boa-dev/criterion-compare-action@v3
47+
with:
48+
cwd: opentelemetry
49+
branchName: ${{ env.BRANCH_NAME }}
50+
- uses: boa-dev/criterion-compare-action@v3
51+
with:
52+
cwd: opentelemetry-appender-tracing
53+
features: spec_unstable_logs_enabled
54+
branchName: ${{ env.BRANCH_NAME }}
55+
- uses: boa-dev/criterion-compare-action@v3
56+
with:
57+
cwd: opentelemetry-sdk
58+
features: rt-tokio,testing,metrics,logs,spec_unstable_metrics_views
59+
branchName: ${{ env.BRANCH_NAME }}

.github/workflows/pr_criterion.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)