Skip to content

Commit 8c214e4

Browse files
committed
feat: add ci test.
1 parent 9309cc8 commit 8c214e4

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,22 @@ jobs:
2424
run: |
2525
cd backend
2626
uv venv
27-
uv pip install -r requirements.txt -r requirements-dev.txt
27+
uv pip install -r requirements.txt -r requirements-dev.txt pytest-cov
2828
29-
- name: Run tests
29+
- name: Run tests with coverage
3030
run: |
3131
cd backend
3232
source .venv/bin/activate
33-
pytest
33+
export PYTHONPATH=$PYTHONPATH:.
34+
pytest --cov=app --cov-report=xml
35+
36+
- name: Upload coverage to Codecov
37+
uses: codecov/codecov-action@v4
38+
with:
39+
file: ./backend/coverage.xml
40+
flags: backend
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
continue-on-error: true
3443

3544
frontend-tests:
3645
runs-on: ubuntu-latest
@@ -48,14 +57,21 @@ jobs:
4857
run: |
4958
cd frontend
5059
npm ci
51-
npm install -D vitest jsdom @testing-library/react @testing-library/jest-dom @testing-library/dom
5260
5361
- name: Lint
5462
run: |
5563
cd frontend
5664
npm run lint
5765
58-
- name: Run tests
66+
- name: Run tests with coverage
5967
run: |
6068
cd frontend
61-
npm test
69+
npm test -- --coverage
70+
71+
- name: Upload coverage to Codecov
72+
uses: codecov/codecov-action@v4
73+
with:
74+
file: ./frontend/coverage/clover.xml
75+
flags: frontend
76+
token: ${{ secrets.CODECOV_TOKEN }}
77+
continue-on-error: true

0 commit comments

Comments
 (0)