Skip to content

Commit

Permalink
add SHA envs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnv1 committed Feb 4, 2024
1 parent da695ad commit e0bfc78
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/pr_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
jobs:
benchmark_cpu:
name: CPU Pytest benchmark
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: kornia/workflows/.github/actions/env@v1.5.3
Expand All @@ -25,6 +25,8 @@ jobs:

- name: Setup benchmarks
run: |
echo "BASE_SHA=$(echo ${{ github.event.pull_request.base.sha }} | cut -c1-8)" >> $GITHUB_ENV
echo "HEAD_SHA=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-8)" >> $GITHUB_ENV
echo "HEAD_JSON=$(mktemp)" >> $GITHUB_ENV
echo "BASE_JSON=$(mktemp)" >> $GITHUB_ENV
echo "PR_COMMENT=$(mktemp)" >> $GITHUB_ENV
Expand All @@ -36,9 +38,9 @@ jobs:
run: |
cd benchmarks/
git checkout ${{ github.event.pull_request.base.sha }}
pytest -vvv --benchmark-json ${{ env.BASE_JSON }}
pytest ./ -vvv --benchmark-json ${{ env.BASE_JSON }}
git checkout ${{ github.sha }}
pytest -vvv --benchmark-json ${{ env.HEAD_JSON }}
pytest ./ -vvv --benchmark-json ${{ env.HEAD_JSON }}
- name: Comment results
uses: apbard/pytest-benchmark-commenter@v3
Expand Down

0 comments on commit e0bfc78

Please sign in to comment.