-
Notifications
You must be signed in to change notification settings - Fork 21
36 lines (33 loc) · 1.37 KB
/
bench.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
# According to:
# - https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#issue_comment
# - https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context
#
name: Benchmark PR
permissions:
contents: read
pull-requests: write
on:
issue_comment:
types: [created]
jobs:
runBenchmark:
if: |
github.event.issue.pull_request &&
contains(github.event.comment.body, '/benchmark')
name: Criterion benchmark
runs-on: ubuntu-latest
steps:
- name: Checkout to init the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get PR base branch name
run: |
branchName=$(curl -s https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.issue.number }} | python3 -c "import sys, json; print(json.load(sys.stdin)['base']['ref'])")
echo "branchName=$branchName" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Compares PR branch to target
uses: boa-dev/criterion-compare-action@adfd3a94634fe2041ce5613eb7df09d247555b87 # v3.2.4
with:
branchName: ${{ env.branchName }}
benchName: "bench_archive"
token: ${{ secrets.GITHUB_TOKEN }}