Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
956434b
Update pyproject.toml
winwinashwin Mar 27, 2026
aa97b7f
Add ty.toml
winwinashwin Mar 28, 2026
74d4290
Delete .python-version
winwinashwin Mar 28, 2026
f75e408
Setup base project
winwinashwin Mar 28, 2026
400c464
deps: Add dependencies for postgres and sqlite
winwinashwin Mar 29, 2026
eee2ef4
feat: Add sqlalchemy backed result backend and tests
winwinashwin Mar 29, 2026
075808a
deps: Add oracledb and oracle extra to dependencies
winwinashwin Mar 29, 2026
a245cbc
feat: Add support for oracle result backend
winwinashwin Mar 29, 2026
f4d937e
chore: Ignore log files
winwinashwin Mar 29, 2026
279a6e5
chore: Delete scripts dir
winwinashwin Mar 29, 2026
62483c7
refactor: Move docker compose + init scripts to docker/
winwinashwin Mar 29, 2026
27d2bd7
feat: Add postgres,oracle,polling brokers + unit tests
winwinashwin Mar 29, 2026
c0eca22
chore: Handle optional deps similar to sqlalchemy
winwinashwin Mar 30, 2026
7b9c39a
refactor: Handle typing better in SQLAlchemy manager
winwinashwin Mar 30, 2026
59b870b
refactor: Add more ruff rules and resolve errors
winwinashwin Mar 30, 2026
c6639c8
chore: Setup linting workflow
winwinashwin Mar 30, 2026
1e7c344
deps: Add aioodbc to mssql extras
winwinashwin Mar 30, 2026
0025529
feat: Add broker dialect for SQL Server using Service Brokers
winwinashwin Mar 30, 2026
ade08e2
refactor: Standardize credentials across test db setups
winwinashwin Mar 30, 2026
61e71c5
chore: Add pytest to ci
winwinashwin Mar 30, 2026
b71d962
deps: Add aioodbc to dev dependencies
winwinashwin Mar 30, 2026
860934a
chore: Update README.md
winwinashwin Mar 30, 2026
c0bcf9d
feat: Add UPSERT specializations for sqlite, postgres and mysql
winwinashwin Mar 30, 2026
c41df79
feat: Add support for MySQL
winwinashwin Mar 30, 2026
83bc409
chore: Add tests in CI for mssql
winwinashwin Mar 30, 2026
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
309 changes: 232 additions & 77 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,25 @@ name: CI

on:
push:
branches: [ main, develop ]
branches:
- main
pull_request:
branches: [ main, develop ]
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number || github.ref }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
lint:
name: "Lint"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
uses: astral-sh/setup-uv@v7

- name: Set up Python
run: uv python install 3.12
Expand All @@ -24,109 +29,259 @@ jobs:
run: uv sync --dev

- name: Run ruff check
run: uv run ruff check --output-format=github .
run: uvx ruff@latest check --output-format=github .

- name: Run ruff format
run: uv run ruff format --check .
run: uvx ruff@latest format --check .

test-generic:
name: "Tests · Generic"
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Set up Python
run: uv python install 3.12

- name: Install dependencies
run: uv sync --dev

- name: Run generic tests
run: |
uv run pytest tests/ -v \
-m "not postgresql and not oracle and not mssql" \
--strict-markers --maxfail=10 \
--cov=taskiq_sqlalchemy \
--cov-report=xml:coverage-generic.xml

# - name: Upload coverage
# uses: codecov/codecov-action@v5
# with:
# files: coverage-generic.xml
# flags: generic
# fail_ci_if_error: false

test-postgresql:
name: "Tests · PostgreSQL"
runs-on: ubuntu-latest
needs: lint

steps:
- uses: actions/checkout@v6

- name: Start PostgreSQL service
run: |
cd docker
docker compose up -d postgres

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Set up Python
run: uv python install 3.12

- name: Install dependencies
run: uv sync --dev

- name: Wait for PostgreSQL to be healthy
run: |
cd docker
echo "Waiting for PostgreSQL service to become healthy..."
for i in $(seq 1 60); do
if [ "$(docker compose ps postgres --format json | jq -r '.Health')" = "healthy" ]; then
echo "PostgreSQL is healthy after ${i}s"
exit 0
fi
sleep 2
done
echo "PostgreSQL did not become healthy within 120 seconds"
exit 1

- name: Run postgresql tests
run: |
uv run pytest tests/ -v \
-m "postgresql" \
--strict-markers --maxfail=10 \
--cov=taskiq_sqlalchemy \
--cov-report=xml:coverage-postgresql.xml

# - name: Upload coverage
# uses: codecov/codecov-action@v5
# with:
# files: coverage-postgresql.xml
# flags: postgresql
# fail_ci_if_error: false

test:
test-oracle:
name: "Tests · Oracle"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
driver: ["asyncpg", "psycopg", "psqlpy"]
include:
- driver: asyncpg
extra: asyncpg
- driver: psycopg
extra: psycopg
- driver: psqlpy
extra: psqlpy

services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: taskiq_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
needs: lint

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Start Oracle service
run: |
cd docker
docker compose up -d oracle

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
uses: astral-sh/setup-uv@v7

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Set up Python
run: uv python install 3.12

- name: Install dependencies
run: uv sync --dev

- name: Wait for Oracle to be healthy
run: |
uv sync --dev --group ${{ matrix.extra }}
cd docker
echo "Waiting for Oracle service to become healthy..."
for i in $(seq 1 60); do
if [ "$(docker compose ps oracle --format json | jq -r '.Health')" = "healthy" ]; then
echo "Oracle is healthy after ${i}s"
exit 0
fi
sleep 2
done
echo "Oracle did not become healthy within 120 seconds"
exit 1

- name: Run tests with pytest
env:
TEST_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/taskiq_test
TEST_DRIVER: ${{ matrix.driver }}
- name: Run oracle tests
run: |
uv run pytest tests/ -v --cov=taskiq_postgresql --cov-report=xml --cov-report=term-missing
uv run pytest tests/ -v \
-m "oracle" \
--strict-markers --maxfail=10 \
--cov=taskiq_sqlalchemy \
--cov-report=xml:coverage-oracle.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: matrix.python-version == '3.12' && matrix.driver == 'asyncpg' && secrets.CODECOV_TOKEN != ''
with:
file: ./coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
# - name: Upload coverage
# uses: codecov/codecov-action@v5
# with:
# files: coverage-oracle.xml
# flags: oracle
# fail_ci_if_error: false

integration-test:
test-mssql:
name: "Tests · MSSQL"
runs-on: ubuntu-latest
needs: lint

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Start MSSQL service
run: |
cd docker
docker compose up -d mssql.configurator

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
uses: astral-sh/setup-uv@v7

- name: Set up Python
run: uv python install 3.12

- name: Start services
run: docker-compose up -d
- name: Install dependencies
run: uv sync --dev

- name: Install MS ODBC driver
run: |
# See: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server
if ! [[ "18.04 20.04 22.04 24.04 25.10" == *"$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)"* ]];
then
echo "Ubuntu $(grep VERSION_ID /etc/os-release | cut -d '"' -f 2) is not currently supported.";
exit;
fi

- name: Wait for PostgreSQL
curl -sSL -O https://packages.microsoft.com/config/ubuntu/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb

sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
echo "$PATH:/opt/mssql-tools18/bin" >> $GITHUB_PATH

- name: Wait for MSSQL to be healthy
run: |
for i in {1..30}; do
if docker-compose exec -T postgres pg_isready -U postgres; then
echo "PostgreSQL is ready"
break
cd docker
echo "Waiting for MSSQL service to become healthy..."
for i in $(seq 1 60); do
if [ "$(docker compose ps mssql --format json | jq -r '.Health')" = "healthy" ]; then
echo "MSSQL is healthy after ${i}s"
exit 0
fi
echo "Waiting for PostgreSQL... ($i/30)"
sleep 2
done
echo "MSSQL did not become healthy within 120 seconds"
exit 1

- name: Run mssql tests
run: |
uv run pytest tests/ -v \
-m "mssql" \
--strict-markers --maxfail=10 \
--cov=taskiq_sqlalchemy \
--cov-report=xml:coverage-mssql.xml

- name: Install all driver dependencies
# - name: Upload coverage
# uses: codecov/codecov-action@v5
# with:
# files: coverage-mssql.xml
# flags: mssql
# fail_ci_if_error: false

test-mysql:
name: "Tests · MySQL"
runs-on: ubuntu-latest
needs: lint

steps:
- uses: actions/checkout@v6

- name: Start MySQL service
run: |
cd docker
docker compose up -d mysql

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Set up Python
run: uv python install 3.12

- name: Install dependencies
run: uv sync --dev

- name: Wait for MySQL to be healthy
run: |
uv sync --dev --group asyncpg --group psycopg --group psqlpy
cd docker
echo "Waiting for MySQL service to become healthy..."
for i in $(seq 1 60); do
if [ "$(docker compose ps mysql --format json | jq -r '.Health')" = "healthy" ]; then
echo "MySQL is healthy after ${i}s"
exit 0
fi
sleep 2
done
echo "MySQL did not become healthy within 120 seconds"
exit 1

- name: Run integration tests
env:
TEST_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres
- name: Run mysql tests
run: |
uv run pytest tests/ -v -m "integration" --tb=short
uv run pytest tests/ -v \
-m "mysql" \
--strict-markers --maxfail=10 \
--cov=taskiq_sqlalchemy \
--cov-report=xml:coverage-mysql.xml

- name: Stop services
if: always()
run: docker-compose down
# - name: Upload coverage
# uses: codecov/codecov-action@v5
# with:
# files: coverage-mysql.xml
# flags: mysql
# fail_ci_if_error: false
Loading
Loading