From 49234d7f134fd366ec8db336e6ea8d5d61e0dff1 Mon Sep 17 00:00:00 2001 From: Gar Date: Mon, 1 Jul 2024 08:27:19 -0700 Subject: [PATCH] chore: remove .github/workflows/benchmark.yml It has historically not worked very consistently and we don't have the bandwidth to keep fixing it. --- .github/workflows/benchmark.yml | 87 --------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 .github/workflows/benchmark.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 750477e652645..0000000000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: Benchmark - CLI - -on: - pull_request: - branches: - - '*' - paths: - - lib/** - - workspaces/**/lib/** - issue_comment: - types: - - created - - edited - -jobs: - trigger-benchmark: - runs-on: ubuntu-latest - steps: - - name: Incoming Pull Request - if: | - ( - github.event_name == 'pull_request' && - github.event.pull_request.head.repo.full_name == 'npm/cli' - ) || ( - github.event_name == 'issue_comment' && - github.event.issue.pull_request && - github.event.issue.state == 'open' && - startsWith(github.event.comment.body, '@npm-cli-bot benchmark this') - ) - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.BENCHMARK_DISPATCH_TOKEN }} - script: | - const { - payload, - eventName, - repo: { owner, repo }, - issue: { number }, - } = context - - if (eventName === 'issue_comment') { - const res = await github.rest.repos.getCollaboratorPermissionLevel({ - owner, - repo, - username: payload.comment.user.login, - }) - if (res.data.permission !== 'admin') { - core.info(`Commenter is not an admin, exiting`) - return - } - - // add emoji to comment if user is an admin to signal benchmark is running - await github.rest.reactions.createForIssueComment({ - owner, - repo, - comment_id: payload.comment.id, - content: 'rocket', - }) - } - - const pullRequest = payload.pull_request || await github.rest.pulls.get({ - owner, - repo, - pull_number: number, - }).then(r => r.data) - - core.info(`Pull request: ${pullRequest.number}`) - core.info(`Base ref: ${pullRequest.base.ref}`) - - const matchesRelease = pullRequest.base.ref.match(/^release\/v(\d+)$/) - const targetSpec = matchesRelease ? matchesRelease[1] : 'latest' - core.info(`Target spec: ${targetSpec}`) - - const eventType = `${eventName} ${owner}/${repo}#${pullRequest.number}` - core.info(`Event type: ${eventType}`) - - await github.rest.repos.createDispatchEvent({ - owner: 'npm', - repo: 'benchmarks', - event_type: eventType, - client_payload: { - owner, - repo, - pr_id: number, - target_spec: targetSpec, - }, - })