-
-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into faulty/circular-dependencies-plugin
- Loading branch information
Showing
423 changed files
with
9,517 additions
and
2,521 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
0043842221e9a8ff8914d644ddcdedb4a359ef8a | ||
ad68a593001497a9f0e78d9277d18f1bd613bacb | ||
734ba4cfbec00ab68ff55bac95e7740fe8228229 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ team: | |
- "@SoonIter" | ||
- "@fi3ework" | ||
- "@Timeless0911" | ||
- "@GiveMe-A-Name" |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
name: ecosystem-benchmark | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr: | ||
type: number | ||
description: "Run Benchmark PR number" | ||
required: true | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- "**/*.md" | ||
- "website/**" | ||
tags-ignore: | ||
- "**" | ||
|
||
jobs: | ||
get-runner-labels: | ||
name: Get Runner Labels | ||
uses: ./.github/workflows/get-runner-labels.yml | ||
|
||
build: | ||
name: Test Linux | ||
needs: [get-runner-labels] | ||
uses: ./.github/workflows/reusable-build.yml | ||
with: | ||
target: x86_64-unknown-linux-gnu | ||
native: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS == '"ubuntu-22.04"' }} | ||
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }} | ||
ref: ${{ github.event_name == 'workflow_dispatch' && format('pull/{0}/head', inputs.pr) || github.sha }} | ||
test: false | ||
bench: false | ||
|
||
create-comment: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
comment-id: ${{ steps.create-comment.outputs.result }} | ||
steps: | ||
- id: create-comment | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
result-encoding: string | ||
script: | | ||
const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` | ||
const urlLink = `[Open](${url})` | ||
const body = `⏳ Triggered benchmark: ${urlLink}` | ||
if (context.eventName === 'workflow_dispatch') { | ||
const { data: comment } = await github.rest.issues.createComment({ | ||
issue_number: context.payload.inputs.pr, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body | ||
}) | ||
return comment.id | ||
} | ||
const { data: comment } = await github.rest.repos.createCommitComment({ | ||
commit_sha: context.sha, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body | ||
}) | ||
return comment.id | ||
bench: | ||
needs: [build] | ||
runs-on: [self-hosted, benchmark] | ||
outputs: | ||
diff-result: ${{ steps.run-benchmark.outputs.diff-result }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event_name == 'workflow_dispatch' && format('pull/{0}/head', inputs.pr) || github.sha }} | ||
|
||
- name: Clean | ||
uses: ./.github/actions/clean | ||
with: | ||
target: x86_64-unknown-linux-gnu | ||
|
||
- name: Download bindings | ||
uses: ./.github/actions/download-artifact | ||
with: | ||
name: bindings-x86_64-unknown-linux-gnu | ||
path: crates/node_binding/ | ||
try-local-cache: false | ||
|
||
- name: Show restored binding | ||
shell: bash | ||
run: ls -lah crates/node_binding/*.node | ||
|
||
- name: Pnpm Cache | ||
uses: ./.github/actions/pnpm-cache | ||
|
||
- name: Build JS | ||
run: pnpm run build:js | ||
|
||
- name: Run rspack-ecosystem-benchmark | ||
id: run-benchmark | ||
run: | | ||
RSPACK_DIR=$(pwd) | ||
git clone --single-branch --depth 1 https://github.com/web-infra-dev/rspack-ecosystem-benchmark.git | ||
cd rspack-ecosystem-benchmark | ||
pnpm i | ||
RSPACK_DIR="$RSPACK_DIR" node bin/cli.js bench | ||
result=$(node bin/cli.js compare --base latest --current current) | ||
echo "$result" | ||
echo "diff-result=${result//$'\n'/'@@'}" >> $GITHUB_OUTPUT | ||
comment-compare-results: | ||
runs-on: ubuntu-latest | ||
needs: [create-comment, bench] | ||
if: ${{ !cancelled() }} | ||
steps: | ||
- uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const diffResult = `${{ needs.bench.outputs.diff-result }}` | ||
let result = "task ${{ needs.bench.result }}" | ||
if (diffResult) { | ||
result = diffResult.replace(/@@/g, "\n"); | ||
} | ||
const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` | ||
const urlLink = `[Open](${url})` | ||
const body = ` | ||
📝 Benchmark detail: ${urlLink} | ||
${result} | ||
` | ||
if (context.eventName === 'workflow_dispatch') { | ||
await github.rest.issues.updateComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
comment_id: `${{ needs.create-comment.outputs.comment-id }}`, | ||
body | ||
}) | ||
} else { | ||
await github.rest.repos.updateCommitComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
comment_id: `${{ needs.create-comment.outputs.comment-id }}`, | ||
body, | ||
}); | ||
} | ||
if (result.includes("Threshold exceeded")) { | ||
console.log("Some benchmark cases exceed the threshold, please visit the previous step for more information"); | ||
process.exit(1); | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.