-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (90 loc) · 2.49 KB
/
Copy pathci.yml
File metadata and controls
94 lines (90 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CI
on:
push:
branches: [main, master]
pull_request:
jobs:
backend:
name: Backend (lint + test)
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv sync --extra dev
- name: Ruff check
run: uv run ruff check src tests
- name: Mypy (scoped)
run: uv run mypy -p src.providers -p src.config -p src.api -p src.storage
- name: Pytest
env:
DEBUG: "true"
ENCRYPTION_KEY: ci-test-encryption-key-not-for-prod
run: uv run pytest -q --ignore=tests/test_postgres_provider.py
backend-postgres:
name: Backend (Postgres provider)
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: astrasql
POSTGRES_PASSWORD: astrasql
POSTGRES_DB: astrasql_ci
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U astrasql -d astrasql_ci"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv sync --extra dev
- name: Postgres provider smoke
env:
DEBUG: "true"
ENCRYPTION_KEY: ci-test-encryption-key-not-for-prod
ASTRASQL_PG_DSN: postgresql+asyncpg://astrasql:astrasql@localhost:5432/astrasql_ci
run: uv run pytest -q tests/test_postgres_provider.py -m postgres
frontend:
name: Frontend (lint + test + build)
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install
run: npm ci
- name: Lint
run: npm run lint
- name: Typecheck
run: npm run typecheck
- name: Test
run: npm test
- name: Build
run: npm run build