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
78 changes: 78 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: "Prepare Build Environment"
description: "Checkout, cache, build liburing, and install Python deps"
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
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') }}

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

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Build liburing (if cache miss)
if: steps.cache-liburing.outputs.cache-hit != 'true'
shell: bash
run: |
cd libs
./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: |
cd libs
sudo make install

- name: Install UV
uses: astral-sh/setup-uv@v5
with:
version: "0.6.2"
enable-cache: true

- name: Install Python dependencies (if cache miss)
if: steps.cache-python.outputs.cache-hit != 'true'
shell: bash
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') }}
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: ci

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Prepare environment
uses: ./.github/actions/prepare

- name: Lint
run: uv run ruff check uringloop tests

- name: Run tests
run: uv run pytest tests/ -v
27 changes: 6 additions & 21 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,18 @@ permissions:
jobs:
release-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive # Initializes and fetches submodules
fetch-depth: 0 # Needed for submodule hashes

- uses: actions/setup-python@v5
- name: Checkout Repo
uses: actions/checkout@v4
with:
python-version: "3.12"
submodules: recursive
fetch-depth: 0

- name: Install the liburing
run: |
cd libs
./configure
make
sudo make install

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
version: "0.6.2"
enable-cache: true
- name: Prepare environment
uses: ./.github/actions/prepare

- name: Build release distributions
run: |
uv sync --group dev
uv build -v --sdist

- name: Upload distributions
Expand Down