From b534e8b5556f08ac5f6691aad80de6f61c18f7b4 Mon Sep 17 00:00:00 2001 From: jerrykingxyz Date: Fri, 27 Dec 2024 14:21:27 +0800 Subject: [PATCH] test --- .github/workflows/ecosystem-benchmark.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ecosystem-benchmark.yml b/.github/workflows/ecosystem-benchmark.yml index 413e3e6e3c8..869ecc014e8 100644 --- a/.github/workflows/ecosystem-benchmark.yml +++ b/.github/workflows/ecosystem-benchmark.yml @@ -10,6 +10,7 @@ on: push: branches: - main + - jerry/test paths-ignore: - "**/*.md" - "website/**" @@ -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 @@ -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 } @@ -66,6 +68,7 @@ jobs: return comment.id bench: + needs: [build] runs-on: [self-hosted] outputs: diff-result: ${{ steps.run-benchmark.outputs.diff-result }} @@ -73,7 +76,7 @@ jobs: - 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 @@ -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 @@ -116,7 +119,7 @@ jobs: steps: - uses: actions/github-script@v7 with: - github-token: ${{ secrets.RSPACK_BOT_ACCESS_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} script: | const diffResult = `${{ needs.bench.outputs.diff-result }}`