Skip to content

Commit

Permalink
ci: Try CodSpeed (#2013)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Oct 16, 2023
1 parent 47db586 commit 673f769
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 15 deletions.
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

on:
push:
branches:
- "main"
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:
- name: Check out the repository
uses: actions/[email protected]

- name: Setup Python 3.11
uses: actions/[email protected]
with:
python-version: 3.11
architecture: x64

- name: Install poetry
run: |
curl -fsS https://install.python-poetry.org | python - -y
- name: Configure poetry
run: poetry config virtualenvs.create false

- name: Install project
run: >
poetry install
-vvv
--with dev
--with benchmark
--all-extras
- name: Run benchmarks
uses: CodSpeedHQ/action@v1
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: pytest tests/ --codspeed
8 changes: 0 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jobs:
- { session: tests, python-version: "3.11", os: "ubuntu-latest", sqlalchemy: "1.*" }
- { session: doctest, python-version: "3.10", os: "ubuntu-latest", sqlalchemy: "2.*" }
- { session: mypy, python-version: "3.8", os: "ubuntu-latest", sqlalchemy: "2.*" }
- { session: benches, python-version: "3.10", os: "ubuntu-latest", sqlalchemy: "2.*" }

steps:
- name: Check out the repository
Expand Down Expand Up @@ -101,13 +100,6 @@ jobs:
name: coverage-data
path: ".coverage.*"

- name: Upload Benchmark Result
if: always() && (matrix.session == 'benches')
uses: actions/[email protected]
with:
name: benchmark_results
path: output.json

tests-external:
name: External Tests
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"duckdb",
"duckdb-engine",
"pytest",
"pytest-snapshot",
"pytest-durations",
"pytest-benchmark",
"pytest-durations",
"pytest-snapshot",
"pyarrow",
"requests-mock",
"time-machine",
Expand Down
45 changes: 41 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ numpy = [
{ version = ">=1.22", python = ">=3.8" },
]
pyarrow = ">=11,<13"
pytest-benchmark = "^4.0.0"
pytest-snapshot = ">=0.9.0"
requests-mock = ">=1.10.0"
time-machine = ">=2.10.0"
Expand All @@ -119,7 +120,9 @@ types-requests = ">=2.28.11"
types-simplejson = ">=3.18.0"
types-PyYAML = ">=6.0.12"
xdoctest = ">=1.1.1"
pytest-benchmark = "^4.0.0"

[tool.poetry.group.benchmark.dependencies]
pytest-codspeed = "^2.2.0"

[tool.black]
exclude = ".*simpleeval.*"
Expand Down

0 comments on commit 673f769

Please sign in to comment.