Update asv-benchmark.yml #13
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
name: ASV Benchmark | |
on: | |
push: | |
branches: | |
- main # Run benchmarks on every commit to the main branch | |
workflow_dispatch: | |
jobs: | |
benchmark: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' # or the version you want to test | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install asv # Install ASV | |
pip install -e ".[test]" # Your project dependencies, if needed | |
- name: Fetch gh-pages branch | |
run: | | |
git fetch origin performance | |
git checkout performance || git checkout --orphan performance | |
- name: Run ASV benchmarks | |
run: | | |
asv machine --yes | |
asv run | |
asv publish | |
- name: Publish benchmark results | |
run: | | |
asv publish | |
git add .asv | |
git commit -m "Update benchmark results" | |
git push origin performance | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: .asv/html | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |