Skip to content

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Dec 19, 2024
1 parent da3060b commit 2cad1a8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ on:
bench: # Run benchmarks?
type: boolean
required: false
default: true
default: false
ref: # Git reference to checkout
required: false
type: string
Expand Down Expand Up @@ -395,24 +395,22 @@ jobs:
bench:
name: Bench
needs: build
if: inputs.bench
if: ${{ inputs.bench && !inputs.skipable }}
runs-on: ${{ fromJSON(needs.build.outputs.runner-labels) }}
steps:
- name: Checkout
if: ${{ !inputs.skipable }}
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
clean: ${{ startsWith(runner.name, 'GitHub Actions') }}

- name: Clean
if: ${{ !inputs.skipable && !startsWith(runner.name, 'GitHub Actions') }}
if: ${{ !startsWith(runner.name, 'GitHub Actions') }}
uses: ./.github/actions/clean
with:
target: ${{ inputs.target }}

- name: Download bindings
if: ${{ !inputs.skipable }}
uses: ./.github/actions/download-artifact
with:
name: bindings-${{ inputs.target }}
Expand All @@ -421,23 +419,29 @@ jobs:
link-when-local: true

- name: Show restored binding
if: ${{ !inputs.skipable }}
shell: bash
run: ls -lah crates/node_binding/*.node

- name: Setup Pnpm
if: ${{ !inputs.skipable }}
uses: ./.github/actions/pnpm-cache
with:
node-version: 20

- name: Install Rust Toolchain
if: ${{ !inputs.skipable }}
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 }}

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

- name: Build JS
run: pnpm run build:js

- name: Install cargo-codspeed binary
uses: taiki-e/install-action@v2
with:
tool: cargo-codspeed

- name: Build Benchmark
run: cargo codspeed build -p rspack_benchmark --features codspeed

- name: Run benchmark
uses: CodSpeedHQ/action@v3
timeout-minutes: 30
Expand Down
2 changes: 1 addition & 1 deletion packages/bench/fixtures/ts-react/rspack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const targets = ["chrome >= 87", "edge >= 88", "firefox >= 78", "safari >= 14"];
export default defineConfig({
context: __dirname,
entry: {
main: "./src/main.tsx"
main: "./src/index.tsx"
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
Expand Down

0 comments on commit 2cad1a8

Please sign in to comment.