From e88d848755802bcaa3aeabf237d57be209de18fc Mon Sep 17 00:00:00 2001 From: Michael Perrotte Date: Fri, 1 Nov 2019 14:42:47 -0400 Subject: [PATCH] feat: added workflow to trigger and run benchmarks [2] PR-URL: https://github.com/npm/cli/pull/278 Credit: @mikemimik Close: #278 Reviewed-by: @claudiahdz --- .github/workflows/benchmark.yml | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/benchmark.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 0000000000000..db9d16e701054 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,49 @@ +--- +name: Benchmark Suite + +on: + push: + branches: + - "latest" + pull_request: + branches: + - "**" + +jobs: + build: + name: Trigger Benchmarks + + runs-on: ubuntu-latest + + steps: + # Checkout the npm/cli repo + - uses: actions/checkout@v1.1.0 + + # Installs the specific version of nodejs + - name: Use nodejs 12.x + uses: actions/setup-node@v1 + with: + node-version: "12.x" + + # Trigger Webhook + - name: Trigger Webhook + env: + DISPATCH_REPO: "benchmarks" + DISPATCH_OWNER: "npm" + run: | + curl \ + -s \ + -X POST https://api.github.com/repos/${DISPATCH_OWNER}/${DISPATCH_REPO}/dispatches \ + -H "Accept: application/vnd.github.everest-preview+json" \ + -H "Authorization: token ${{ secrets.NPM_DEPLOY_USER_PAT }}" \ + -d \ + ' + { + "event_type": "${{ github.event_name }}", + "client_payload": { + "pr_id": "${{ github.event.pull_request.number }}", + "repo": "${{ github.event.repository.name }}", + "owner": "${{ github.event.repository.owner.login }}", + "commit_sha": "${{ github.event.after }}" + } + }'