(AUTO-GENERATED) Added benchmark files (#31) #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install run speed benchmarks at each merged PR on main | |
# and track benchmarks history. | |
name: Post-merge | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
types: [closed] | |
jobs: | |
run-and-push-benchmarks: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade poetry | |
python -m poetry install --with dev | |
- name: Run benchmarks | |
run: python -m poetry run pytest --benchmark-warmup="on" --benchmark-enable --benchmark-autosave | |
- name: Log benchmark | |
run: poetry run pytest-benchmark compare --group-by="func" > benchmarks-history.txt | |
- name: Checkout new branch | |
run: | | |
git config --global user.name "Continuous Integration" | |
git config --global user.email "[email protected]" | |
git checkout -b CI/benchmarks | |
- name: Add benchmark and history files | |
run: git add . | |
- name: Commit benchmark files | |
run: git commit -m "(AUTO-GENERATED) Added benchmark files" | |
- name: Push changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: git push --set-upstream origin CI/benchmarks | |
- name: Create PR from new branch | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh pr create -B main --assignee remydubois -t "(CI) Benchmarks update" -b "Adding benchmark results" |