next.js/.github/workflows/test-turbopack-rust-bench-test.yml
test-turbopack-rust-bench-test.yml76 lines2.1 KB
name: Turbopack Rust testing benchmarks
on:
  workflow_call:
    inputs:
      runner:
        type: string
        default: '["ubuntu-latest-16-core-oss"]'
      os:
        type: string
        default: 'linux'
      all:
        type: boolean
        default: false

env:
  TURBOPACK_BENCH_COUNTS: '100'
  TURBOPACK_BENCH_PROGRESS: '1'
  NODE_LTS_VERSION: 20
  TURBO_TEAM: 'vtest314-next-adapter-e2e-tests'
  TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}

jobs:
  test:
    name: Test
    runs-on: ${{ fromJSON(inputs.runner) }}
    steps:
      - name: Set git to use LF
        run: |
          git config --global core.autocrlf false
          git config --global core.eol lf
        if: inputs.os == 'windows'

      - name: Checkout
        uses: actions/checkout@v3

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

      - name: Setup node
        uses: actions/setup-node@v4
        with:
          node-version: ${{ env.NODE_LTS_VERSION }}
          check-latest: true
      - run: corepack enable

      # We need to install the dependencies for the benchmark apps
      - run: pnpm install
        working-directory: turbopack/benchmark-apps

      - name: Start sccache
        uses: ./.github/actions/sccache
        with:
          turbo-token: ${{ secrets.TURBO_TOKEN }}

      - name: Build benchmarks for tests
        timeout-minutes: 120
        run: |
          cargo test --benches --workspace --release --no-fail-fast --exclude turbopack-bench --exclude next-napi-bindings --no-run

      - name: Run cargo test on benchmarks
        timeout-minutes: 120
        run: |
          cargo test --benches --workspace --release --no-fail-fast --exclude turbopack-bench --exclude next-napi-bindings

      - name: Build benchmarks for tests for other bundlers
        if: inputs.all
        timeout-minutes: 120
        run: |
          cargo test --benches --release -p turbopack-bench --no-run

      - name: Run cargo test on benchmarks for other bundlers
        if: inputs.all
        timeout-minutes: 120
        run: |
          cargo test --benches --release -p turbopack-bench
Quest for Codev2.0.0
/
SIGN IN