Skip to content

Add MIT License and update README with license badge #5

Add MIT License and update README with license badge

Add MIT License and update README with license badge #5

Workflow file for this run

name: CI Pipeline
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch: # Allows manual triggering
jobs:
lint:
name: Lint & Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
# Add uv to the PATH
- name: Add uv to PATH
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies (including dev)
run: uv pip install --system -e '.[test,dev]' # Need dev for ruff
- name: Lint with Ruff
run: uv run ruff check .
- name: Check formatting with Ruff
run: uv run ruff format --check .
test:
name: Run Tests
runs-on: ubuntu-latest
needs: lint # Ensure linting passes before testing
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
# Add uv to the PATH
- name: Add uv to PATH
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies (including test)
run: uv pip install --system -e '.[test]'
- name: Run tests with pytest
env:
# Provide a dummy secret for testing. For real secrets, use GitHub encrypted secrets.
# Dynaconf will pick these up. Ensure prefix matches if you customized it.
FAPI_JWT_SECRET_KEY: "a_secure_test_secret_key_for_ci_minimum_32_chars_long"
FAPI_DATABASE_TYPE: "sqlite" # Force SQLite for CI tests
FAPI_SQL_DATABASE_URL: "sqlite+aiosqlite:///./test_ci.db" # Use a separate DB file for CI runs
PYTHONPATH: "." # Ensure app modules can be imported
run: uv run pytest -v --cov=app --cov-report=xml # Generate coverage report
# Optional: Upload coverage report to a service like Codecov
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }} # Add CODECOV_TOKEN to your GitHub repository secrets
# fail_ci_if_error: true