Skip to content

ci(bench): add oxlint JS plugins benchmark #1

ci(bench): add oxlint JS plugins benchmark

ci(bench): add oxlint JS plugins benchmark #1

# Benchmark for oxlint JS plugin (ESLint rules)
#
# See https://docs.codspeed.io/features/sharded-benchmarks
name: Benchmark Oxlint
permissions: {}
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
paths:
- "crates/**"
- "apps/oxlint/**"
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/benchmark-oxlint.yml"
push:
branches:
- main
paths:
- "crates/**"
- "apps/oxlint/**"
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/benchmark-oxlint.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
benchmark-node:
name: Bench Node (ESLint Rules)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, '0-merge') }}
permissions:
id-token: write # required for OIDC authentication with CodSpeed
steps:
- uses: taiki-e/checkout-action@3ab630d442e198ebb0ca30872832406ca01c46eb # v1.4.0
- uses: oxc-project/setup-rust@c8224157c0bf235aabc633e8cd50d344f087a7de # v1.0.12
with:
cache-key: benchmark-node
save-cache: ${{ github.ref_name == 'main' }}
- uses: oxc-project/setup-node@cd99f47b69fd6bb2497ab48e0e8c30cc9f1e80b3 # v1.0.6
- run: pnpm install --frozen-lockfile
- name: Initialize conformance submodules
working-directory: apps/oxlint/conformance
run: ./init.sh
- name: Build NAPI bindings
working-directory: apps/oxlint
run: pnpm run build-dev
- name: Run benchmark
uses: CodSpeedHQ/action@e736f0d2aeb36da38e9f08eca4dff7967408d154 # v4.8.2
timeout-minutes: 30
with:
run: cd apps/oxlint && pnpm bench