|
15 | 15 | name: benchmark pull requests
|
16 | 16 | permissions:
|
17 | 17 | contents: read
|
18 |
| - |
19 | 18 | jobs:
|
20 | 19 | runBenchmark:
|
21 | 20 | name: run benchmark
|
22 | 21 | permissions:
|
23 | 22 | pull-requests: write
|
24 | 23 |
|
25 |
| - # If we're running on a PR, use ubuntu-latest - a shared runner. We can't use the self-hosted |
26 |
| - # runners on arbitrary PRs, and we don't want to unleash that load on the pool anyway. |
27 |
| - # If we're running on main, use the OTEL self-hosted runner pool. |
28 |
| - |
29 |
| - # TODO - temporarily move main to the shared workers, until we've resolved the instance setup issue |
30 |
| - # runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-latest' || 'self-hosted' }} |
31 |
| - runs-on: 'ubuntu-latest' |
| 24 | + # If we're running on main, use our oracle bare-metal runner for accuracy. |
| 25 | + # If we're running on a PR, use github's shared workers to save resources. |
| 26 | + runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-latest' || 'oracle-bare-metal-64cpu-512gb-x86-64' }} |
32 | 27 | if: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'performance')) || github.event_name == 'push' }}
|
| 28 | + container: |
| 29 | + image: rust:slim-bullseye |
33 | 30 | env:
|
34 | 31 | # For PRs, compare against the base branch - e.g., 'main'.
|
35 | 32 | # For pushes to main, compare against the previous commit
|
36 | 33 | BRANCH_NAME: ${{ github.event_name == 'pull_request' && github.base_ref || github.event.before }}
|
| 34 | + GIT_DISCOVERY_ACROSS_FILESYSTEM: 1 |
37 | 35 | steps:
|
38 | 36 | - name: Harden the runner (Audit all outbound calls)
|
39 | 37 | uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
|
40 | 38 | with:
|
41 | 39 | egress-policy: audit
|
42 | 40 |
|
| 41 | + - name: Setup container environment |
| 42 | + run: | |
| 43 | + apt-get update && apt-get install --fix-missing -y unzip cmake build-essential pkg-config curl git |
| 44 | + cargo install cargo-criterion |
| 45 | +
|
| 46 | + - name: Make repo safe for Git inside container |
| 47 | + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" |
| 48 | + |
43 | 49 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
44 | 50 | with:
|
45 |
| - fetch-depth: 10 # Fetch current commit and its parent |
| 51 | + fetch-depth: 10 # Fetch a bit of history so we can do perf diffs |
| 52 | + |
46 | 53 | - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
|
47 | 54 | with:
|
48 | 55 | repo-token: ${{ secrets.GITHUB_TOKEN }}
|
49 |
| - - uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b |
50 |
| - with: |
51 |
| - toolchain: stable |
| 56 | + |
52 | 57 | - uses: boa-dev/criterion-compare-action@adfd3a94634fe2041ce5613eb7df09d247555b87 # v3.2.4
|
53 | 58 | with:
|
54 | 59 | branchName: ${{ env.BRANCH_NAME }}
|
0 commit comments