diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 8544abef39..3d25af619c 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -12,6 +12,7 @@ on: push: branches: - main + - dependabot/scottgerring/benchmark-fix name: benchmark pull requests permissions: contents: read @@ -25,10 +26,10 @@ jobs: # 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. - - # TODO - temporarily move main to the shared workers, until we've resolved the instance setup issue + # + # TODO - temporarily use self-hosted to get shared-worker environment going + runs-on: 'self-hosted' # runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-latest' || 'self-hosted' }} - runs-on: 'ubuntu-latest' 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'. @@ -43,9 +44,23 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 10 # Fetch current commit and its parent - - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Run benchmark inside Docker + run: | + docker run --rm \ + -v "$PWD":/workspace \ + -w /workspace \ + rust:slim-bullseye \ + bash -c " + apt-get update && apt-get install -y unzip cmake build-essential pkg-config curl git && \ + cargo install cargo-criterion && \ + cargo bench && \ + echo 'Benchmark run complete inside Docker container' + " + + # - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0 + # with: + # repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 with: toolchain: stable