51 lines (44 loc) · 1.52 KB
/
benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Benchmarking
on:
issue_comment:
types: [created]
jobs:
benchmark:
runs-on: ubuntu-latest
# runs-on: [self-hosted, plutus-benchmark]
permissions:
pull-requests: write
if: |
startsWith(github.event.comment.body, '/benchmark') &&
github.event.issue.pull_request
steps:
- name: Checkout
uses: actions/checkout@v3.3.0
- name: React with Rocket
uses: actions/github-script@v6
with:
script: |
github.rest.reactions.createForIssueComment({
owner: context.issue.owner,
repo: context.issue.repo,
comment_id: context.payload.comment.id,
content: "rocket"
});
- name: Extract Benchmark Name
id: extract-benchmark
uses: actions/github-script@v6
with:
script: |
const regex = '^\/benchmark\s*(.*?)\s*$';
const comment = context.payload.comment.body;
const match = comment.match(regex)
if (match !== null && match.length == 2)
core.setOutput('benchmark', match[1]);
else
core.setFailed(`Unable to extract benchmark name from {comment}`);
#
# Run the benchmark if the 'benchmark' command was found
#
- run: |
nix develop --no-warn-dirty --accept-flake-config --command bash ./scripts/ci-plutus-benchmark.sh ${{ github.event.issue.number }} ${{ steps.extract-benchmark.outputs.benchmark }}
if: success()