fix(oxlint/lsp): remove uri cache on document change #62321
Workflow file for this run
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] | |
| branches-ignore: | |
| - "**/graphite-base/**" | |
| paths: &paths | |
| - "crates/**/*.rs" | |
| - "tasks/benchmark/**/*.rs" | |
| - "tasks/common/**/*.rs" | |
| - "Cargo.lock" | |
| - "rust-toolchain.toml" | |
| - ".github/workflows/benchmark.yml" | |
| push: | |
| branches: | |
| - main | |
| paths: *paths | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| determine-matrix: | |
| name: Determine Benchmark | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, '0-merge') }} | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - name: Determine affected components | |
| id: set-matrix | |
| env: | |
| GITHUB_EVENT_NAME: ${{ github.event_name }} | |
| GITHUB_BASE_REF: ${{ github.base_ref }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| GITHUB_SHA: ${{ github.sha }} | |
| GITHUB_REF: ${{ github.ref }} | |
| GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| MATRIX=$(node .github/scripts/generate-benchmark-matrix.js) | |
| echo "Matrix: $MATRIX" | |
| echo "matrix=$MATRIX" >> $GITHUB_OUTPUT | |
| benchmark: | |
| needs: determine-matrix | |
| if: needs.determine-matrix.outputs.matrix != '[]' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # required for OIDC authentication with CodSpeed | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJSON(needs.determine-matrix.outputs.matrix) }} | |
| name: Bench ${{ matrix.component }} | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16 | |
| with: | |
| cache-key: benchmark-${{ matrix.feature }} | |
| save-cache: ${{ github.ref_name == 'main' }} | |
| tools: cargo-codspeed | |
| - name: Build benchmark | |
| env: | |
| RUSTFLAGS: "-C debuginfo=1 -C strip=none -g --cfg codspeed" | |
| run: | | |
| if [ "${{ matrix.component }}" = "linter" ]; then | |
| cargo build --release -p oxc_benchmark --bench linter \ | |
| --no-default-features --features ${{ matrix.feature }} --features codspeed | |
| else | |
| cargo build --release -p oxc_benchmark \ | |
| --bench ${{ matrix.component }} \ | |
| --no-default-features --features ${{ matrix.feature }} --features codspeed | |
| fi | |
| mkdir -p target/codspeed/analysis/oxc_benchmark | |
| mv target/release/deps/${{ matrix.component }}-* target/codspeed/analysis/oxc_benchmark | |
| rm target/codspeed/analysis/oxc_benchmark/*.d | |
| - name: Run benchmark | |
| uses: CodSpeedHQ/action@1c8ae4843586d3ba879736b7f6b7b0c990757fab # v4.12.1 | |
| timeout-minutes: 30 | |
| with: | |
| mode: simulation | |
| run: cargo codspeed run ${{ matrix.component }} |