forked from JohnDamilola/FlashCards
-
Notifications
You must be signed in to change notification settings - Fork 3
89 lines (76 loc) · 2.45 KB
/
Coverage.yml
File metadata and controls
89 lines (76 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
name: Coverage Report
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Backend setup
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install backend dependencies
run: |
python -m pip install --upgrade pip
pip install coverage pytest pytest-cov flask firebase-admin flask-cors
if [ -f backend/requirements.txt ]; then pip install -r backend/requirements.txt; fi
- name: Run backend tests with coverage
run: |
cd backend
python -m pytest --cov=src --cov-report=term-missing
python -m coverage xml
python -m coverage html
# # Frontend setup
# - name: Set up Node.js
# uses: actions/setup-node@v2
# with:
# node-version: '20.17.0'
# - name: Install frontend dependencies
# run: |
# cd frontend
# npm install --force
# - name: Run frontend tests with coverage
# run: |
# cd frontend
# npm test -- --coverage --coverageReporters=lcov # Ensure correct report generation
# Upload coverage reports to Codecov
- name: Upload backend coverage report to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./backend/coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
# - name: Upload frontend coverage report to Codecov
# uses: codecov/codecov-action@v3
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# with:
# files: ./frontend/coverage/lcov.info # Update based on actual path
# flags: unittests
# name: codecov-frontend
# fail_ci_if_error: true
# verbose: true
# Archive code coverage results
- name: Archive backend coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: |
backend/coverage.xml
backend/htmlcov
# - name: Archive frontend coverage results
# uses: actions/upload-artifact@v3
# with:
# name: frontend-code-coverage-report
# path: frontend/coverage