1717 postgres :
1818 image : postgres:16
1919 env :
20- POSTGRES_DB : metering_test
20+ POSTGRES_DB : minihes_test
2121 POSTGRES_USER : postgres
2222 POSTGRES_PASSWORD : test
2323 ports : ['5432:5432']
@@ -26,71 +26,44 @@ jobs:
2626 --health-interval 10s
2727 --health-timeout 5s
2828 --health-retries 5
29- redis :
30- image : redis:7-alpine
31- ports : ['6379:6379']
32- options : >-
33- --health-cmd "redis-cli ping"
34- --health-interval 10s
35- --health-timeout 5s
36- --health-retries 5
3729 steps :
3830 - uses : actions/checkout@v4
3931 - uses : astral-sh/setup-uv@v4
4032 with :
4133 enable-cache : true
4234 - run : uv sync
35+ - name : Seed database
36+ run : uv run python -m app.db.seed
37+ env :
38+ DATABASE_URL : postgresql+asyncpg://postgres:test@localhost:5432/minihes_test
4339 - run : uv run pytest --cov=app --cov-report=xml -v
4440 env :
45- DATABASE_URL : postgresql+asyncpg://postgres:test@localhost:5432/metering_test
46- REDIS_URL : redis://localhost:6379/0
41+ DATABASE_URL : postgresql+asyncpg://postgres:test@localhost:5432/minihes_test
4742 - uses : codecov/codecov-action@v4
43+ if : always()
4844 with :
4945 file : backend/coverage.xml
5046 flags : backend
5147
52- frontend-test :
53- name : Frontend Tests
48+ lint :
49+ name : Lint
5450 runs-on : ubuntu-latest
5551 defaults :
5652 run :
57- working-directory : frontend
53+ working-directory : backend
5854 steps :
5955 - uses : actions/checkout@v4
60- - uses : pnpm/action-setup@v4
61- - uses : actions/setup-node@v4
62- with :
63- node-version : 20
64- cache : pnpm
65- cache-dependency-path : frontend/pnpm-lock.yaml
66- - run : pnpm install --frozen-lockfile
67- - run : pnpm run check:type
68- - name : Run Vitest
69- run : cd apps/web-antd && pnpm test -- --coverage
70- - uses : codecov/codecov-action@v4
71- with :
72- flags : frontend
56+ - uses : astral-sh/setup-uv@v4
57+ - run : uv sync
58+ - run : uv run ruff check app/ tests/
59+ - run : uv run ruff format --check app/ tests/
7360
74- e2e -test :
75- name : E2E Tests
61+ frontend -test :
62+ name : Frontend Tests
7663 runs-on : ubuntu-latest
77- needs : [backend-test, frontend-test]
7864 defaults :
7965 run :
80- working-directory : tests/e2e
81- services :
82- postgres :
83- image : postgres:16
84- env :
85- POSTGRES_DB : metering_test
86- POSTGRES_USER : postgres
87- POSTGRES_PASSWORD : test
88- ports : ['5432:5432']
89- options : >-
90- --health-cmd pg_isready
91- --health-interval 10s
92- --health-timeout 5s
93- --health-retries 5
66+ working-directory : frontend
9467 steps :
9568 - uses : actions/checkout@v4
9669 - uses : pnpm/action-setup@v4
9972 node-version : 20
10073 cache : pnpm
10174 cache-dependency-path : frontend/pnpm-lock.yaml
102- - run : cd ../../frontend && pnpm install --frozen-lockfile
103- - run : cd ../../frontend && pnpm build:antd
104- - name : Start backend
105- run : |
106- cd ../../backend
107- pip install uv && uv sync
108- uv run uvicorn main:app --host 0.0.0.0 --port 8000 &
109- sleep 5
110- env :
111- DATABASE_URL : postgresql+asyncpg://postgres:test@localhost:5432/metering_test
112- REDIS_URL : redis://localhost:6379/0
113- - name : Start frontend preview
114- run : |
115- cd ../../frontend/apps/web-antd
116- pnpm preview --port 4173 &
117- sleep 3
118- - run : npm install
119- - run : npx playwright install --with-deps chromium
120- - run : npx playwright test --project=chromium
121- env :
122- E2E_BASE_URL : http://localhost:4173
123- - uses : actions/upload-artifact@v4
124- if : failure()
125- with :
126- name : e2e-report
127- path : tests/e2e/test-results/
128- retention-days : 7
75+ - run : pnpm install --frozen-lockfile
76+ - run : pnpm run check:type
0 commit comments