Skip to content

Commit

Permalink
Add dedicated codspeed GitHub action
Browse files Browse the repository at this point in the history
And disable running benchmarks on appveyor.

Appveyor is not supported by codspeed, and there is no values in running
benchmarks without doing anything with the results.
  • Loading branch information
mih committed Feb 20, 2024
1 parent 1798f06 commit 8ff93bd
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ for:
# run tests on installed module, not source tree files
- |
cd __testhome__
python -m pytest -s -v --durations 20 -m "not (turtle)" -k "$KEYWORDS" --cov=datalad_next --cov datalad --cov-config=../.coveragerc --pyargs ${DTS}
python -m pytest -s -v --durations 20 -m "not (turtle)" -k "$KEYWORDS" --cov=datalad_next --cov datalad --cov-config=../.coveragerc --benchmark-disable --pyargs ${DTS}
after_test:
- python -m coverage xml
Expand Down Expand Up @@ -370,7 +370,7 @@ for:
- cmd: md __testhome__
- cmd: cd __testhome__
# run test selecion (--traverse-namespace needed from Python 3.8 onwards)
- cmd: python -m pytest -s -v --durations 20 -m "not (turtle)" -k "%KEYWORDS%" --cov=datalad_next --cov-config=..\.coveragerc --pyargs %DTS%
- cmd: python -m pytest -s -v --durations 20 -m "not (turtle)" -k "%KEYWORDS%" --cov=datalad_next --cov-config=..\.coveragerc --benchmark-disable --pyargs %DTS%

after_test:
- cmd: python -m coverage xml
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: codspeed-benchmarks

on:
# Run on pushes to the main branch
push:
branches:
- "main"
# Run on pull requests
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
# codspeed needs 3.12 for trace generation
python-version: 3.12
- name: Set up environment
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Almighty"
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install git-annex
run: |
python -m pip install datalad-installer
datalad-installer -E ${HOME}/dlinstaller_env.sh --sudo ok git-annex -m snapshot
- name: Install dependencies
run: |
python -m pip install -r requirements-devel.txt
python -m pip install pytest-codspeed
- name: Run benchmarks
uses: CodSpeedHQ/action@v2
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: |
. ${HOME}/dlinstaller_env.sh
python -m pytest --codspeed datalad_next

0 comments on commit 8ff93bd

Please sign in to comment.