Bench Mako PR #11
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
name: Bench Mako PR | |
on: | |
workflow_dispatch: | |
inputs: | |
prNumber: | |
description: "PR number" | |
required: true | |
type: string | |
jobs: | |
create-comment: | |
runs-on: ubuntu-latest | |
outputs: | |
comment-id: ${{ steps.create-comment.outputs.result }} | |
steps: | |
- id: create-comment | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.MAKO_BOT_ACCESS_TOKEN }} | |
result-encoding: string | |
script: | | |
const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` | |
const urlLink = `[Open](${url})` | |
const { data: comment } = await github.rest.issues.createComment({ | |
issue_number: context.payload.inputs.prNumber, | |
owner: context.repo.owner, | |
repo: 'mako', | |
body: `⏳ Triggered benchmark: ${urlLink}` | |
}) | |
return comment.id | |
bench: | |
runs-on: ubuntu-latest | |
needs: [create-comment] | |
strategy: | |
matrix: | |
shardIndex: [1] | |
shardTotal: [1] | |
fail-fast: false | |
outputs: | |
diff-result: ${{ steps.print-results.outputs.diff-result }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Init env | |
uses: ./.github/actions/env | |
- uses: ./.github/actions/build-mako | |
with: | |
path: ${{ env.MAKO_DIR }} | |
- name: Run benchmark | |
run: node bin/cli.js bench |