Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrykingxyz committed Dec 27, 2024
1 parent 74bf045 commit 810f479
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/ecosystem-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
push:
branches:
- main
- jerry/test
paths-ignore:
- "**/*.md"
- "website/**"
Expand All @@ -29,7 +30,7 @@ jobs:
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) || "refs/heads/main" }}
ref: ${{ github.event_name == 'workflow_dispatch' && format('pull/{0}/head', inputs.pr) || github.sha }}
test: false
bench: false

Expand All @@ -41,18 +42,19 @@ jobs:
- id: create-comment
uses: actions/github-script@v7
with:
github-token: ${{ GITHUB_TOKEN }}
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: 'rspack',
body: `⏳ Triggered benchmark: ${urlLink}`
body
})
return comment.id
}
Expand All @@ -66,14 +68,15 @@ jobs:
return comment.id
bench:
needs: [build]
runs-on: [self-hosted]
outputs:
diff-result: ${{ steps.run-benchmark.outputs.diff-result }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
ref: ${{ github.event_name == 'workflow_dispatch' && format('pull/{0}/head', inputs.pr) || github.sha }}

- name: Clean
uses: ./.github/actions/clean
Expand Down Expand Up @@ -104,7 +107,7 @@ jobs:
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
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
Expand Down

1 comment on commit 810f479

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⏳ Triggered benchmark: Open

Please sign in to comment.