Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lapp0 committed May 17, 2024
1 parent 9bdcab8 commit 3fa87c6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/asv_benchmarks.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
name: Update Historical ASV Benchmarks
name: Update GitHub Pages for Historical ASV Benchmarks

on:
push:
branches: [main]

permissions:
contents: write # Grant write access to repository contents

env:
PYTHON_VERSION: "3.10"
WORKING_DIR: ${{ github.workspace }}/benchmarks
ARTIFACTS_DIR: ${{ github.workspace }}/artifacts

jobs:
update-pages:
runs-on: ubuntu-latest
Expand All @@ -15,13 +23,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
pip install asv asv-runner # PR TODO: move to pyprojct.toml
pip install asv
- name: Create ASV machine config file
run: asv machine --machine gh-runner --yes

- name: Run ASV benchmarks
run: asv run
Expand Down
23 changes: 17 additions & 6 deletions .github/workflows/asv_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ on:
pull_request:
branches: [main]

permissions:
contents: read # Read access for repository contents
pull-requests: write # Write access for pull requests

env:
PYTHON_VERSION: "3.10"
WORKING_DIR: ${{ github.workspace }}/benchmarks
ARTIFACTS_DIR: ${{ github.workspace }}/artifacts

jobs:
benchmark:
runs-on: ubuntu-latest
Expand All @@ -15,13 +24,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
pip install asv asv-runner # PR TODO: move to pyprojct.toml
pip install asv
- name: Create ASV machine config file
run: asv machine --machine gh-runner --yes

- name: Run ASV benchmarks
run: asv run
Expand All @@ -31,11 +42,11 @@ jobs:
git remote add upstream https://github.com/${{ github.repository }}.git
git fetch upstream
asv continuous upstream/main HEAD --verbose || true
asv compare upstream/main HEAD --sort ratio --verbose | tee output
asv compare upstream/main HEAD --sort ratio --verbose | tee ${{ env.ARTIFACTS_DIR }}/output
- name: Post benchmark results as PR comment
uses: marocchino/sticky-pull-request-comment@v2
with:
token: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
header: "Benchmark Results"
path: output
path: ${{ env.ARTIFACTS_DIR }}/output

0 comments on commit 3fa87c6

Please sign in to comment.