Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bench: try codspeed for continuous benchmarking #69191

Draft
wants to merge 7 commits into
base: canary
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/bench-turbopack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Benchmark Turbopack
on:
push:
branches: [canary]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
actions: write
contents: read
pull-requests: read

jobs:
turbopack_rust_check:
name: Turbopack rust check
runs-on:
- 'self-hosted'
- 'linux'
- 'x64'
- 'metal'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
targets: wasm32-unknown-unknown

- name: Run cargo check release
run: |
RUSTFLAGS="-D warnings -A deprecated" cargo check --workspace --all-targets --features rustls-tls --release

turbopack_bench_pr:
needs: [turbopack_rust_check]
if: github.event_name == 'pull_request'
name: Benchmark and compare Turbopack performance on ${{ matrix.os.title }}
strategy:
fail-fast: false
matrix:
os:
- name: linux
title: Linux
quiet: false
runs-on:
- 'self-hosted'
- 'linux'
- 'x64'
- 'metal'

runs-on: ${{ matrix.os.runs-on }}
permissions:
contents: read
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v4

# - name: Fetch the base branch
# run: git -c protocol.version=2 fetch --no-tags --progress --no-recurse-submodules --depth=1 origin +${{ github.base_ref }}:base

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodeVersion || env.NODE_LTS_VERSION }}
check-latest: true

- run: node -v
- run: corepack enable

- name: Setup Rust
uses: ./.github/actions/setup-rust

- uses: taiki-e/install-action@v2
with:
tool: cargo-codspeed

- name: Build the benchmark target(s)
run: cargo codspeed build --workspace --exclude turbopack-bench --exclude turbopack-cli --exclude next-swc-napi --exclude wasm

- name: Run the benchmarks
uses: CodSpeedHQ/action@v3
with:
run: cargo codspeed run --workspace --exclude turbopack-bench --exclude turbopack-cli --exclude next-swc-napi --exclude wasm
token: ${{ secrets.CODSPEED_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/test-turbopack-rust-bench-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
if: inputs.os == 'windows'

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Rust
uses: ./.github/actions/setup-rust
Expand Down
Loading
Loading