-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (74 loc) · 1.98 KB
/
test.yml
File metadata and controls
78 lines (74 loc) · 1.98 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
name: Test
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
backend-test:
name: Backend Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: minihes_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: test
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- run: uv sync
- name: Seed database
run: uv run python -m app.db.seed
env:
DATABASE_URL: postgresql+asyncpg://postgres:test@localhost:5432/minihes_test
- run: uv run pytest --cov=app --cov-report=xml -v
env:
DATABASE_URL: postgresql+asyncpg://postgres:test@localhost:5432/minihes_test
- uses: codecov/codecov-action@v4
if: always()
with:
file: backend/coverage.xml
flags: backend
lint:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- run: uv sync
- run: uv run ruff check app/ tests/
- run: uv run ruff format --check app/ tests/
frontend-test:
name: Frontend Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
package_json_file: frontend/package.json
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @vben/web-antd run typecheck