feat(linter): expose tsgolint program diagnostics (#15080) #47726
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: &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@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.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 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJSON(needs.determine-matrix.outputs.matrix) }} | |
| name: Bench ${{ matrix.component }} | |
| steps: | |
| - uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1 | |
| - uses: oxc-project/setup-rust@1ff88fdaffd6ae35c0fb32ccc159340b37d0beac # v1.0.7 | |
| 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 lexer --bench parser --bench transformer --bench semantic \ | |
| --bench minifier --bench codegen --bench formatter \ | |
| --no-default-features --features ${{ matrix.feature }} --features codspeed | |
| fi | |
| 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@4348f634fa7309fe23aac9502e88b999ec90a164 # v4.3.1 | |
| timeout-minutes: 30 | |
| with: | |
| token: ${{ secrets.CODSPEED_TOKEN }} | |
| mode: instrumentation | |
| run: cargo codspeed run ${{ matrix.component }} |