2021-12-14 16:05:25 +01:00
|
|
|
name: Benchmark
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [ labeled ]
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
issues: write
|
|
|
|
pull-requests: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
if: github.event.label.name == 'benchmark'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-03 17:16:56 +01:00
|
|
|
- uses: actions/checkout@v3
|
2022-03-01 15:17:41 +01:00
|
|
|
- uses: actions/setup-python@v3
|
2021-12-14 16:05:25 +01:00
|
|
|
with:
|
|
|
|
python-version: "3.9"
|
|
|
|
|
|
|
|
- id: benchmarks
|
|
|
|
name: Run Benchmarks
|
|
|
|
run: |
|
|
|
|
python -m pip install pyperf>=2.3.0
|
|
|
|
python extras/profiling/run.py --fresh --complex --min-speed=6 --file output.txt
|
|
|
|
body=$(cat output.txt)
|
|
|
|
body="${body//'%'/'%25'}"
|
|
|
|
body="${body//$'\n'/'%0A'}"
|
|
|
|
body="${body//$'\r'/'%0D'}"
|
|
|
|
echo "::set-output name=body::$body"
|
|
|
|
|
|
|
|
- name: Find Comment
|
2022-03-22 20:49:25 +01:00
|
|
|
uses: peter-evans/find-comment@v2
|
2021-12-14 16:05:25 +01:00
|
|
|
id: fc
|
|
|
|
with:
|
|
|
|
issue-number: ${{ github.event.pull_request.number }}
|
|
|
|
comment-author: 'github-actions[bot]'
|
|
|
|
body-includes: '# Benchmarks'
|
|
|
|
|
|
|
|
- name: Create or update comment
|
2022-03-22 20:50:08 +01:00
|
|
|
uses: peter-evans/create-or-update-comment@v2
|
2021-12-14 16:05:25 +01:00
|
|
|
with:
|
|
|
|
comment-id: ${{ steps.fc.outputs.comment-id }}
|
|
|
|
issue-number: ${{ github.event.pull_request.number }}
|
|
|
|
body: |
|
|
|
|
# Benchmarks
|
|
|
|
${{ steps.benchmarks.outputs.body }}
|
|
|
|
edit-mode: replace
|
|
|
|
|
|
|
|
- uses: actions-ecosystem/action-remove-labels@v1
|
|
|
|
with:
|
|
|
|
labels: benchmark
|