Skip to content

Introduce PR Benchmark Workflow #10

Introduce PR Benchmark Workflow

Introduce PR Benchmark Workflow #10

name: Benchmark PR
on:
pull_request:
branches: [main]
workflow_dispatch:
env:
PYTHON_VERSION: "3.10"
WORKING_DIR: ${{ github.workspace }}/benchmarks
FAIL_THRSHOLD: 1.1
jobs:
benchmark-pr:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'run_benchmarks') || github.event_name == 'workflow_dispatch'
defaults:
run:
working-directory: ${{ env.WORKING_DIR }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install asv virtualenv lf-asv-formatter
- name: Create ASV machine config file
run: asv machine --machine gh-runner --yes
- name: Save comparison of PR against main branch
run: |

Check failure on line 43 in .github/workflows/asv_benchmark_pr.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/asv_benchmark_pr.yml

Invalid workflow file

You have an error in your yaml syntax on line 43
# prepare main branch for comparison
git remote add upstream https://github.com/${{ github.repository }}.git
git fetch upstream main
# Run benchmarks, writing comment contents to ./output
asv continuous upstream/main HEAD \
--skip-existing --sort ratio --split --interleave-rounds -a repeat=1
asv compare upstream/main HEAD --sort ratio --split | tee output
- name: Upload benchmark results
uses: actions/upload-artifact@v2
with:
name: benchmark-results-${{ github.sha }}
path: output
- name: Set benchmark output
run: |
echo "Success: [Benchmark Results](../actions/runs/${{ github.run_id }})"