forked from learnhouse/learnhouse
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.24 KB
/
Copy pathapi-tests.yaml
File metadata and controls
53 lines (47 loc) · 1.24 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
name: API Tests
permissions:
contents: read
on:
push:
branches:
- dev
paths:
- "apps/api/**"
pull_request:
paths:
- "apps/api/**"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v8.2.0
with:
version: latest
- name: Install dependencies
run: uv sync
working-directory: apps/api
- name: Run tests with coverage
run: uv run pytest src/tests/ -v --tb=short --cov=src --cov-report=html --cov-report=term-missing --cov-report=xml:coverage.xml --cov-fail-under=25
working-directory: apps/api
env:
TESTING: "true"
- name: Upload API coverage to Codecov
uses: codecov/codecov-action@v6
with:
files: apps/api/coverage.xml
flags: api
name: api-coverage
fail_ci_if_error: true
- name: Upload coverage report
uses: actions/upload-artifact@v7
if: always()
with:
name: api-coverage-report
path: apps/api/htmlcov/
retention-days: 30