-
Notifications
You must be signed in to change notification settings - Fork 505
54 lines (53 loc) · 2.26 KB
/
benchmark.yml
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
# This workflow runs a Criterion benchmark on a PR and compares the results against the base branch.
# It is triggered on a PR or a push to main.
#
# The workflow is gated on the presence of the "performance" label on the PR.
#
# The workflow runs on a self-hosted runner pool. We can't use the shared runners for this,
# because they are only permitted to run on the default branch to preserve resources.
#
# In the future, we might like to consider using bencher.dev or the framework used by otel-golang here.
on:
pull_request:
push:
branches:
- main
name: benchmark pull requests
jobs:
runBenchmark:
name: run benchmark
permissions:
pull-requests: write
# If we're running on a PR, use ubuntu-latest - a shared runner. We can't use the self-hosted
# runners on arbitrary PRs, and we don't want to unleash that load on the pool anyway.
# If we're running on main, use the OTEL self-hosted runner pool.
runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-latest' || 'self-hosted' }}
if: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'performance')) || github.event_name == 'push' }}
env:
# For PRs, compare against the base branch - e.g., 'main'.
# For pushes to main, compare against the previous commit
BRANCH_NAME: ${{ github.event_name == 'pull_request' && github.base_ref || github.event.before }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 10 # Fetch current commit and its parent
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: boa-dev/criterion-compare-action@v3
with:
cwd: opentelemetry
branchName: ${{ env.BRANCH_NAME }}
- uses: boa-dev/criterion-compare-action@v3
with:
cwd: opentelemetry-appender-tracing
features: spec_unstable_logs_enabled
branchName: ${{ env.BRANCH_NAME }}
- uses: boa-dev/criterion-compare-action@v3
with:
cwd: opentelemetry-sdk
features: rt-tokio,testing,metrics,logs,spec_unstable_metrics_views
branchName: ${{ env.BRANCH_NAME }}