Skip to content

Merge pull request #8 from lapp0/issue-883 #6

Merge pull request #8 from lapp0/issue-883

Merge pull request #8 from lapp0/issue-883 #6

Workflow file for this run

name: Update GitHub Pages
on:
push:
branches: [main]
env:
PYTHON_VERSION: "3.10"
WORKING_DIR: ${{ github.workspace }}/benchmarks
ARTIFACTS_DIR: ${{ github.workspace }}/artifacts
jobs:
update-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
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
- name: Run ASV benchmarks
run: asv run
- name: Checkout the benchmarks repository
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
TARGET_REPO: ${{ vars.TARGET_REPO }}
TARGET_BRANCH: ${{ vars.TARGET_BRANCH }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git clone https://x-access-token:${GH_TOKEN}@github.com/${TARGET_REPO}.git -b ${TARGET_BRANCH} benchmarks-repo
- name: Copy ASV results to benchmarks repository
run: |
rm -rf benchmarks-repo/asv_results
mv asv_results benchmarks-repo/
- name: Commit and push ASV results
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
cd benchmarks-repo
git add asv_results
git commit -m "Update ASV benchmarks"
git push origin ${TARGET_BRANCH}