Skip to content

Commit

Permalink
Update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ringsaturn committed Sep 16, 2024
1 parent 22da069 commit dbf5aa3
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 41 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/Bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,3 @@ jobs:
--adapter python_pytest \
--err \
"pytest --benchmark-json results.json tests/test_bench.py"
benchmark_with_codspeed:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Restore uv cache
uses: actions/cache@v4
with:
path: ${{ env.UV_CACHE_DIR }}
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install
run: |
uv build --config-setting profile==profiling
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
with:
run: uv run pytest tests/ --codspeed

- name: Minimize uv cache
run: uv cache prune --ci
48 changes: 48 additions & 0 deletions .github/workflows/CodSpeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Bench

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

env:
UV_CACHE_DIR: "/tmp/.uv-cache"

jobs:
benchmark_with_codspeed:
name: Continuous Benchmarking with CodSpeed
runs-on: ubuntu-latest
steps:
- name: Collect Workflow Telemetry
uses: runforesight/workflow-telemetry-action@v2
with:
comment_on_pr: false
- uses: actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Restore uv cache
uses: actions/cache@v4
with:
path: ${{ env.UV_CACHE_DIR }}
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install
run: |
uv build --config-setting profile==profiling
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
with:
run: uv run pytest tests/ --codspeed

- name: Minimize uv cache
run: uv cache prune --ci
20 changes: 10 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ features = ["pyo3/extension-module"]

[tool.uv]
dev-dependencies = [
"ruff>=0.6.5",
"citiespy>=0.6.3",
"maturin>=1.7.1",
"pytest>=8.3.3",
"pytest-benchmark>=4.0.0",
"pytest-cov>=5.0.0",
"pytest-pretty>=1.2.0",
"pytz>=2024.2",
"tzdata>=2024.1",
"pytest-codspeed>=2.2.1",
"ruff>=0.6.5",
"citiespy>=0.6.3",
"maturin>=1.7.1",
"pytest>=8.3.3",
"pytest-benchmark>=4.0.0",
"pytest-cov>=5.0.0",
"pytest-pretty>=1.2.0",
"pytz>=2024.2",
"tzdata>=2024.1",
"pytest-codspeed>=2.2.1",
]

0 comments on commit dbf5aa3

Please sign in to comment.