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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
116 changes: 101 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,39 @@ on:

env:
PYTHON_VERSION: "3.13"
NODE_VERSION: "22"

jobs:
lint:
name: Lint & Format
# Detect which paths changed
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
server: ${{ steps.filter.outputs.server }}
web: ${{ steps.filter.outputs.web }}
steps:
- uses: actions/checkout@v4

- name: Install just
uses: extractions/setup-just@v2
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
server:
- 'server/**'
web:
- 'web/**'

# Server (Python backend) checks
server-lint:
name: Server - Lint & Format
needs: changes
if: needs.changes.outputs.server == 'true' || github.event_name == 'push'
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
Expand All @@ -36,15 +59,17 @@ jobs:
- name: Check linting
run: uv run ruff check .

typecheck:
name: Type Check
server-typecheck:
name: Server - Type Check
needs: changes
if: needs.changes.outputs.server == 'true' || github.event_name == 'push'
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- uses: actions/checkout@v4

- name: Install just
uses: extractions/setup-just@v2

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
Expand All @@ -59,18 +84,20 @@ jobs:
- name: Run type checker
run: uv run ty check osa

test:
name: Test
server-test:
name: Server - Test
needs: changes
if: needs.changes.outputs.server == 'true' || github.event_name == 'push'
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4

- name: Install just
uses: extractions/setup-just@v2

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
Expand All @@ -90,7 +117,7 @@ jobs:
- name: Code Coverage Summary
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage.xml
filename: server/coverage.xml
badge: true
format: markdown
output: both
Expand All @@ -100,3 +127,62 @@ jobs:
if: github.event_name == 'pull_request'
with:
path: code-coverage-results.md

# Web (Next.js frontend) checks
web-lint:
name: Web - Lint
needs: changes
if: needs.changes.outputs.web == 'true' || github.event_name == 'push'
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: web/pnpm-lock.yaml

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run linter
run: pnpm lint

web-build:
name: Web - Build
needs: changes
if: needs.changes.outputs.web == 'true' || github.event_name == 'push'
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: web/pnpm-lock.yaml

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build
25 changes: 24 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
Expand Down Expand Up @@ -214,3 +213,27 @@ __marimo__/

# Streamlit
.streamlit/secrets.toml

# Monorepo - Server specific
server/.venv/
server/.coverage
server/.coverage.*
server/coverage.xml
server/htmlcov/
server/.pytest_cache/
server/.ruff_cache/
server/__pycache__/
server/*.egg-info/

# Monorepo - Web specific
web/node_modules/
web/.next/
web/.env.local
web/.turbo/

# Docker
.docker/

# Environment
.env
!.env.example
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ repos:
hooks:
- id: ty-check
name: ty type check
entry: uv run ty check osa
entry: env -u VIRTUAL_ENV uv run --directory server ty check osa
language: system
types: [python]
pass_filenames: false

- id: unit-tests
name: unit tests
entry: uv run pytest tests/unit -q --tb=short
entry: env -u VIRTUAL_ENV uv run --directory server pytest tests/unit -q --tb=short
language: system
types: [python]
pass_filenames: false
Expand Down
Loading
Loading