Goal
Set up GitHub Actions to automatically run linting, type checking, and builds on every push and pull request to dev.
Background
The AGENTS.md review checklist lists:
ruff check . (Python)
ruff format --check . (Python)
tsc -b (TypeScript)
npm run lint (frontend)
vite build (frontend build)
These should run automatically in CI to prevent broken PRs from being merged.
Deliverables
.github/workflows/ci.yml
A single CI workflow with the following jobs:
Job 1: Backend Lint (Python)
backend-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: '3.12' }
- run: pip install ruff
- run: ruff check adapters/ backend/ db/ pipeline/ scripts/
- run: ruff format --check adapters/ backend/ db/ pipeline/ scripts/
Job 2: Frontend Type Check & Build
frontend-build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- run: npx tsc -b
- run: npm run lint
- run: npm run build
Job 3: Backend Tests
backend-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:16-3.4
env:
POSTGRES_DB: constructnear_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports: [ '5432:5432' ]
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: '3.12' }
- run: |
pip install -r backend/requirements.txt
pip install pytest pytest-asyncio httpx
- run: psql -h localhost -U postgres -d constructnear_test -f db/schema.sql
env: { PGPASSWORD: postgres }
- run: pytest backend/tests -v
env: { DATABASE_URL_TEST: 'postgres://postgres:postgres@localhost:5432/constructnear_test' }
Status Badges
Add a badge to the top of README-deploy.md:
[](https://github.com/z4ab/real-estate/actions/workflows/ci.yml)
Conventions
- Workflow triggers:
push and pull_request on dev branch
- Fail fast: if any job fails, the entire workflow is marked failed
- Cancel in-progress runs for the same branch on new pushes
- Use
actions/cache for pip and npm to speed up subsequent runs
Acceptance Criteria
Goal
Set up GitHub Actions to automatically run linting, type checking, and builds on every push and pull request to
dev.Background
The AGENTS.md review checklist lists:
ruff check .(Python)ruff format --check .(Python)tsc -b(TypeScript)npm run lint(frontend)vite build(frontend build)These should run automatically in CI to prevent broken PRs from being merged.
Deliverables
.github/workflows/ci.ymlA single CI workflow with the following jobs:
Job 1: Backend Lint (Python)
Job 2: Frontend Type Check & Build
Job 3: Backend Tests
Status Badges
Add a badge to the top of
README-deploy.md:Conventions
pushandpull_requestondevbranchactions/cachefor pip and npm to speed up subsequent runsAcceptance Criteria
.github/workflows/ci.ymlexists with 3 jobstsc -b) passesnpm run lint) passesdevtrigger the workflowdevtrigger the workflow