43 lines (39 loc) · 1.18 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
name: Benchmarking
on:
issue_comment:
types: [created]
jobs:
benchmark:
runs-on: ubuntu-latest
env:
BUILDKITE_API_ACCESS_TOKEN: ${{ secrets.BUILDKITE_API_ACCESS_TOKEN }}
steps:
#
# Checkout the repository so that we can use scripts from it
#
- name: Checkout
uses: actions/checkout@v2
#
# Check for '/benchmark' comments on a PR
#
- uses: khan/pull-request-comment-trigger@master
id: check
with:
trigger: '/benchmark'
reaction: rocket
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
#
# Extract the branch of that the PR the comment was added to belongs to
#
- uses: xt0rted/pull-request-comment-branch@v1
if: steps.check.outputs.triggered == 'true'
id: comment-branch
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
#
# Trigger the buildkite pipeline IF the 'benchmark' command was found
#
- run: |
./scripts/trigger-buildkite-pipeline.sh ${{ steps.comment-branch.outputs.head_ref }} ${{ github.event.issue.number }}
if: steps.check.outputs.triggered == 'true'