-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (85 loc) · 2.45 KB
/
Copy pathci.yml
File metadata and controls
91 lines (85 loc) · 2.45 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
name: CI
on:
push:
branches: ['**']
pull_request:
branches: [main]
jobs:
lint-backend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/api
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- run: uv sync --frozen
- run: uv run ruff check src/ tests/
- run: uv run ruff format --check src/ tests/
- run: uv run mypy src/
test-backend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/api
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: helprs_test
POSTGRES_USER: helprs
POSTGRES_PASSWORD: helprs
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U helprs"
--health-interval 5s
--health-timeout 3s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- run: uv sync --frozen
- run: uv run pytest --cov=helprs --cov-report=term-missing --cov-fail-under=70
env:
DATABASE_URL: postgresql+asyncpg://helprs:helprs@localhost:5432/helprs_test
SECRET_KEY: ci-test-secret-key
FERNET_KEY: "-fB7lL74GHGbXnRClRQTaBP9_flqSUHFC9_c2n3Tvbo="
GITHUB_APP_ID: "000000"
ENVIRONMENT: test
lint-frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/web
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: apps/web/package-lock.json
- run: npm ci
- run: npx eslint src/
test-frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/web
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: apps/web/package-lock.json
- run: npm ci
- run: npx vitest run
build:
runs-on: ubuntu-latest
needs: [lint-backend, test-backend, lint-frontend, test-frontend]
steps:
- uses: actions/checkout@v4
- run: docker build -f infra/docker/Dockerfile.api --target production apps/api
- run: docker build -f infra/docker/Dockerfile.web --target production apps/web
- run: docker build -f infra/docker/claude-runner/Dockerfile infra/docker/claude-runner