Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v5
with:
Expand All @@ -53,16 +54,20 @@ jobs:
run: sudo apt-get install valgrind -y
- name: Install dependencies with pytest${{ matrix.pytest-version }}
run: |
pip install .[dev,compat,build] "pytest${{ matrix.pytest-version }}"
pip uninstall -y pytest-benchmark
if [ "${{ matrix.config }}" == "valgrind" ]; then
export PYTEST_CODSPEED_FORCE_EXTENSION_BUILD=1
fi
uv sync --all-extras --dev --locked --verbose
uv pip install "pytest${{ matrix.pytest-version }}"
uv pip uninstall pytest-benchmark
- if: matrix.config == 'pytest-benchmark-4'
name: Install pytest-benchmark 4.0.0
run: pip install pytest-benchmark~=4.0.0
run: uv pip install pytest-benchmark~=4.0.0
- if: matrix.config == 'pytest-benchmark-5'
name: Install pytest-benchmark 5.0.0
run: pip install pytest-benchmark~=5.0.0
run: uv pip install pytest-benchmark~=5.0.0
- name: Run tests
run: pytest -vs
run: uv run --no-sync pytest -vs

all-checks:
runs-on: ubuntu-latest
Expand Down
33 changes: 29 additions & 4 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,45 @@ on:
branches: [master]
workflow_dispatch:

env:
PYTHON_VERSION: "3.12"

jobs:
build:
name: Build wheel
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install valgrind
run: sudo apt-get install valgrind -y
- name: Build the wheel
run: uv build --wheel --out-dir dist/
- uses: actions/upload-artifact@v4
with:
name: wheel
path: dist/*.whl

benchmarks:
name: Run benchmarks
needs: build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python 3.12
uses: actions/setup-python@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/download-artifact@v4
with:
python-version: "3.12"
name: wheel
path: dist
- name: Install local version of pytest-codspeed
run: pip install .
run: pip install dist/*.whl
- name: Run benchmarks
uses: CodSpeedHQ/action@main
with:
Expand Down
61 changes: 48 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,70 @@ on:
push:
tags:
- "v*"
workflow_dispatch:

permissions:
id-token: write
contents: write

jobs:
build:
runs-on: ubuntu-latest
build-wheels:
strategy:
matrix:
platform:
- runs-on: ubuntu-24.04
arch: x86_64
- runs-on: buildjet-8vcpu-ubuntu-2204-arm
arch: aarch64

runs-on: ${{ matrix.platform.runs-on }}
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_ARCHS: ${{ matrix.platform.arch }}
with:
output-dir: wheelhouse

- uses: actions/upload-artifact@v4
with:
fetch-depth: 0
name: wheels-${{ matrix.platform.arch }}
path: wheelhouse/*.whl

publish:
needs: build-wheels
runs-on: ubuntu-24.04
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist/
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- uses: actions/setup-python@v2
with:
python-version: "3.11"
python-version: "3.12"

- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist/

- name: Install dependencies
run: pip install hatch
- name: Build the source dist
run: uv build --sdist --out-dir dist/

- name: Build the library
run: hatch build
- name: List artifacts
run: ls -al dist/*

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- if: github.event_name == 'push'
name: Publish to PyPI
run: uv publish --trusted-publishing=always dist/*

- name: Create a draft release
- if: github.event_name == 'push'
name: Create a draft release
run: |
NEW_VERSION=$(hatch project metadata | jq -r '.version')
gh release create v$NEW_VERSION --title "v$NEW_VERSION" --generate-notes -d
VERSION="${{ github.ref_name }}"
gh release create $VERSION --title $VERSION --generate-notes -d
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ celerybeat.pid
# Environments
.env
.venv
.venv.*
env/
venv/
ENV/
Expand Down
Loading
Loading