Skip to content

chore: bump version to 0.9.9 #70

chore: bump version to 0.9.9

chore: bump version to 0.9.9 #70

Workflow file for this run

name: CI
on:
push:
branches: [main]
paths:
- 'src/**'
- 'tests/**'
- 'pyproject.toml'
- 'uv.lock'
- '.github/workflows/ci.yml'
pull_request:
branches: [main]
paths:
- 'src/**'
- 'tests/**'
- 'pyproject.toml'
- 'uv.lock'
- '.github/workflows/ci.yml'
workflow_dispatch:
inputs:
python_version:
description: 'Python version to test'
required: false
default: 'all'
type: choice
options:
- 'all'
- '3.10'
- '3.11'
- '3.12'
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: 1
UV_SYSTEM_PYTHON: 1
jobs:
# Job 1: Lint and type checking
lint:
name: Lint & Type Check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: 'latest'
enable-cache: true
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/uv
.venv
key: lint-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
restore-keys: |
lint-${{ runner.os }}-
- name: Install dependencies
run: |
uv sync --frozen --extra dev
- name: Run ruff format check
run: |
echo "🎨 Checking code formatting..."
uv run ruff format --check .
echo "βœ… Format check passed"
- name: Run ruff linting
run: |
echo "πŸ” Running linting checks..."
uv run ruff check .
echo "βœ… Linting passed"
- name: Run mypy type checking
continue-on-error: true
run: |
echo "πŸ”Ž Running type checking (informational only)..."
uv run mypy src/taskrepo || echo "⚠️ Type checking found issues (non-blocking)"
# Job 2: Test matrix across Python versions
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
needs: lint
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.python_version != 'all') && fromJson(format('["{0}"]', github.event.inputs.python_version)) || fromJson('["3.10", "3.11", "3.12"]') }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: 'latest'
enable-cache: true
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/uv
.venv
key: test-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/uv.lock') }}
restore-keys: |
test-${{ runner.os }}-${{ matrix.python-version }}-
- name: Install dependencies
run: |
uv sync --frozen --extra dev
- name: Run unit tests
run: |
echo "πŸ§ͺ Running unit tests..."
uv run pytest tests/unit -v
echo "βœ… Unit tests passed"
- name: Run integration tests
run: |
echo "πŸ§ͺ Running integration tests..."
# Allow empty test collection (exit code 5)
uv run pytest tests/integration -v || [ $? -eq 5 ] && echo "βœ… Integration tests passed (or no tests found)"
# Job 3: Coverage reporting
coverage:
name: Coverage Report
runs-on: ubuntu-latest
needs: lint
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: 'latest'
enable-cache: true
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/uv
.venv
key: coverage-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
restore-keys: |
coverage-${{ runner.os }}-
- name: Install dependencies
run: |
uv sync --frozen --extra dev
- name: Run tests with coverage
run: |
echo "πŸ“Š Running full test suite with coverage..."
uv run pytest tests/ -v --cov=taskrepo --cov-report=term-missing --cov-report=xml
echo "βœ… Coverage report generated"
- name: Upload coverage artifact
uses: actions/upload-artifact@v5
with:
name: coverage-report
path: coverage.xml
retention-days: 30
# Job 4: Build verification
build:
name: Build Package
runs-on: ubuntu-latest
needs: lint
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: 'latest'
enable-cache: true
- name: Install dependencies
run: |
uv sync --frozen --extra dev
- name: Build package
run: |
echo "πŸ“¦ Building package..."
uv build
echo "βœ… Package built successfully"
- name: Verify package metadata
run: |
echo "πŸ” Verifying package contents..."
ls -lh dist/
uv run python -m tarfile -l dist/*.tar.gz
echo "βœ… Package verification complete"
- name: Upload build artifacts
uses: actions/upload-artifact@v5
with:
name: dist-packages
path: dist/
retention-days: 7
# Summary job
ci-summary:
name: CI Summary
runs-on: ubuntu-latest
needs: [lint, test, coverage, build]
if: always()
steps:
- name: Generate summary
run: |
echo "## πŸš€ CI Pipeline Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Job | Status |" >> $GITHUB_STEP_SUMMARY
echo "|-----|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Lint & Type Check | ${{ needs.lint.result == 'success' && 'βœ… Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Tests | ${{ needs.test.result == 'success' && 'βœ… Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Coverage | ${{ needs.coverage.result == 'success' && 'βœ… Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Build | ${{ needs.build.result == 'success' && 'βœ… Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
ALL_PASSED=${{ needs.lint.result == 'success' && needs.test.result == 'success' && needs.coverage.result == 'success' && needs.build.result == 'success' }}
if [[ "$ALL_PASSED" == "true" ]]; then
echo "πŸŽ‰ **All CI checks passed!**" >> $GITHUB_STEP_SUMMARY
else
echo "⚠️ **Some CI checks failed - please review the logs above**" >> $GITHUB_STEP_SUMMARY
fi