wip: skip rules that do not have any relevant node types #41664
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Benchmarks are sharded. | |
# | |
# Each benchmark (parser, transformer, etc) runs in parallel in a separate job. | |
# | |
# See https://docs.codspeed.io/features/sharded-benchmarks | |
name: Benchmark | |
permissions: {} | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [opened, synchronize] | |
paths: | |
- "crates/**/*.rs" | |
- "tasks/benchmark/**/*.rs" | |
- "tasks/common/**/*.rs" | |
- "Cargo.lock" | |
- "rust-toolchain.toml" | |
- ".github/workflows/benchmark.yml" | |
- "tasks/benchmark/codspeed/*.mjs" | |
push: | |
branches: | |
- main | |
paths: | |
- "crates/**/*.rs" | |
- "tasks/benchmark/**/*.rs" | |
- "tasks/common/**/*.rs" | |
- "Cargo.lock" | |
- "rust-toolchain.toml" | |
- ".github/workflows/benchmark.yml" | |
- "tasks/benchmark/codspeed/*.mjs" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
benchmark: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
component: | |
- lexer | |
- parser | |
- transformer | |
- semantic | |
- minifier | |
- codegen | |
- formatter | |
- linter | |
name: Bench ${{ matrix.component }} | |
steps: | |
- name: Checkout Branch | |
uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1 | |
- uses: oxc-project/setup-rust@cd82e1efec7fef815e2c23d296756f31c7cdc03d # v1.0.0 | |
with: | |
cache-key: benchmark-${{ matrix.component }} | |
save-cache: ${{ github.ref_name == 'main' }} | |
tools: cargo-codspeed | |
- name: Build benchmark | |
env: | |
RUSTFLAGS: "-C debuginfo=1 -C strip=none -g --cfg codspeed" | |
run: | | |
cargo build --release -p oxc_benchmark --bench ${{ matrix.component }} \ | |
--no-default-features --features ${{ matrix.component }} --features codspeed | |
mkdir -p target/codspeed/instrumentation/oxc_benchmark | |
mv target/release/deps/${{ matrix.component }}-* target/codspeed/instrumentation/oxc_benchmark | |
rm target/codspeed/instrumentation/oxc_benchmark/*.d | |
- name: Run benchmark | |
uses: CodSpeedHQ/action@0b6e7a3d96c9d2a6057e7bcea6b45aaf2f7ce60b # v3.8.0 | |
timeout-minutes: 30 | |
with: | |
token: ${{ secrets.CODSPEED_TOKEN }} | |
run: cargo codspeed run |