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
57 changes: 15 additions & 42 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,28 @@
name: "Prepare Build Environment"
description: "Checkout, cache, build liburing, and install Python deps"
description: "Build/install liburing and install Python deps (repo must already be checked out with submodules)"
inputs:
python-version:
description: "Python version to set up"
required: false
default: "3.12"
runs:
using: "composite"
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Get system info and liburing commit hash
- name: Get liburing commit hash
id: cache-info
shell: bash
run: |
echo "sysinfo=$(uname -a | md5sum | cut -d ' ' -f1)" >> $GITHUB_OUTPUT
echo "liburing_hash=$(cd libs && git rev-parse HEAD)" >> $GITHUB_OUTPUT

- name: Cache Python dependencies
id: cache-python
uses: actions/cache@v3
with:
path: |
.venv
~/.cache/uv
key: ${{ runner.os }}-py-${{ hashFiles('uv.lock') }}
run: echo "liburing_hash=$(cd libs && git rev-parse HEAD)" >> $GITHUB_OUTPUT

- name: Cache liburing build
id: cache-liburing
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: libs/
key: ${{ steps.cache-info.outputs.os }}-${{ steps.cache-info.outputs.arch }}-liburing-${{ steps.cache-info.outputs.liburing_hash }}
key: ${{ runner.os }}-${{ runner.arch }}-liburing-${{ steps.cache-info.outputs.liburing_hash }}

- uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: ${{ inputs.python-version }}

- name: Build liburing (if cache miss)
if: steps.cache-liburing.outputs.cache-hit != 'true'
Expand All @@ -44,13 +32,6 @@ runs:
./configure
make

- name: Save liburing cache
if: steps.cache-liburing.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: libs/
key: ${{ steps.cache-info.outputs.os }}-${{ steps.cache-info.outputs.arch }}-liburing-${{ steps.cache-info.outputs.liburing_hash }}

- name: Install liburing (always)
shell: bash
run: |
Expand All @@ -60,19 +41,11 @@ runs:
- name: Install UV
uses: astral-sh/setup-uv@v5
with:
version: "0.6.2"
version: "0.8.13"
enable-cache: true

- name: Install Python dependencies (if cache miss)
if: steps.cache-python.outputs.cache-hit != 'true'
- name: Install Python dependencies
shell: bash
env:
UV_PYTHON: ${{ inputs.python-version }}
run: uv sync --group dev

- name: Save Python dependencies cache
if: steps.cache-python.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: |
.venv
~/.cache/uv
key: ${{ runner.os }}-py-${{ hashFiles('uv.lock') }}
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,30 @@ on:
pull_request:
branches: [ main ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13"]
env:
UV_PYTHON: ${{ matrix.python-version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Prepare environment
uses: ./.github/actions/prepare
with:
python-version: ${{ matrix.python-version }}

- name: Lint
run: uv run ruff check uringloop tests
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ permissions:
jobs:
release-build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Prepare environment
uses: ./.github/actions/prepare
Expand All @@ -24,9 +24,11 @@ jobs:
run: |
uv build -v --sdist

# TODO: switch to PyPI Trusted Publishing (OIDC) and drop the token:
# https://docs.pypi.org/trusted-publishers/
- name: Upload distributions
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} #
run: |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
uv run twine upload --verbose --repository pypi dist/*
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,17 @@ dev = [
"mdformat>=0.7.22",
"pytest>=8.3.5",
"pytest-asyncio>=0.26.0",
"pytest-timeout>=2.3.1",
"ruff>=0.11.4",
"twine>=6.1.0",
]

## pytest
[tool.pytest.ini_options]
# the e2e tests drive a real event loop; a wedged loop should fail the
# test instead of hanging CI forever
timeout = 120

## ruff
[tool.ruff]
# Exclude a variety of commonly ignored directories.
Expand Down
14 changes: 14 additions & 0 deletions uv.lock

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

Loading