Skip to content

Commit

Permalink
ci: try to parallel codspeed
Browse files Browse the repository at this point in the history
  • Loading branch information
LingyuCoder committed Feb 20, 2025
1 parent b271e1b commit 04979a9
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,8 @@ jobs:

bench:
name: Bench
needs: build
if: ${{ inputs.bench && !inputs.skipable }}
runs-on: ${{ fromJSON(needs.build.outputs.runner-labels) }}
runs-on: ${{ fromJSON(inputs.runner) }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
Expand All @@ -374,24 +373,36 @@ jobs:
with:
target: ${{ inputs.target }}

- name: Install Rust Toolchain
uses: ./.github/actions/rustup
with:
save-cache: ${{ github.ref_name == 'main' }} # This should be safe because we have nightly building the cache every day
shared-key: build-${{ inputs.target }}-${{ inputs.profile }}

- name: Build Benchmark
env:
RUSTFLAGS: "-C debuginfo=1 -C strip=none -g --cfg codspeed"
run: cargo codspeed build -p rspack_benchmark --features codspeed

- name: Wait for build job
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'Build'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

- name: Download bindings
uses: ./.github/actions/download-artifact
with:
name: bindings-${{ inputs.target }}
path: crates/node_binding/
try-local-cache: ${{ inputs.profile == 'ci' }}
link-when-local: true

- name: Show restored binding
shell: bash
run: ls -lah crates/node_binding/*.node

- name: Install Rust Toolchain
uses: ./.github/actions/rustup
with:
save-cache: ${{ github.ref_name == 'main' }} # This should be safe because we have nightly building the cache every day
shared-key: build-${{ inputs.target }}-${{ inputs.profile }}

- name: Pnpm Cache
uses: ./.github/actions/pnpm-cache

Expand All @@ -403,10 +414,6 @@ jobs:
with:
tool: [email protected]

- name: Build Benchmark
env:
RUSTFLAGS: "-C debuginfo=1 -C strip=none -g --cfg codspeed"
run: cargo codspeed build -p rspack_benchmark --features codspeed

- name: Run benchmark
uses: CodSpeedHQ/action@1015f4f828ff74b7a950909897fe581d6ba868cc # v3
Expand Down

0 comments on commit 04979a9

Please sign in to comment.