Skip to content

Commit

Permalink
benchmark workflow added
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakdinesh1123 committed Aug 11, 2022
1 parent e34dfad commit 1f7b44b
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/benchmark.yml
@@ -0,0 +1,36 @@
name: Benchmark

on:
pull_request:
types: [ labeled ]

jobs:
Run_benchmarks:
if: ${{ github.event.label.name == 'benchmark' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Benchmark Repo
uses: actions/checkout@v3
with:
repository: django/django-asv
path: "."
- name: Install Requirements
run: pip install -r requirements.txt
- name: Cache Django
uses: actions/cache@v3
with:
path: Django/*
key: Django
- name: Run Benchmarks
shell: bash -l {0}
run: |-
asv machine --machine ubuntu-latest --yes
echo '```' >> $GITHUB_STEP_SUMMARY
asv continuous --interleave-processes -a processes=2 --split --show-stderr 'HEAD^' 'HEAD' |\
sed -n -E '/(before.*after.*ratio)|(BENCHMARKS)/,$p' >> out.txt
cat out.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
if grep -q "PERFORMANCE DECREASED" out.txt;
then
exit 1
fi

0 comments on commit 1f7b44b

Please sign in to comment.