forked from rohan22shah/slash-phase3
-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (72 loc) · 1.86 KB
/
code_cov.yml
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
name: Running Code Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Python 3.7.17
uses: actions/setup-python@v1
with:
python-version: 3.7.17
- name: Install dependencies
run: |
pip install coverage
pip install pytest-cov
pip install -r requirements.txt
echo requirements installed
- name: Run the tests
run: |
cd tests
pytest --cov=./ --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# This workflow will install Python dependencies, run tests and create a Code Coverage Report
#name: Code Coverage
#
#on:
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
#
#jobs:
# build:
#
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@main
# - uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
#
# - name: Generate coverage report
# run: |
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# pip install pytest
# pip install pytest-cov
# export PYTHONPATH=src
# cd tests
# pytest --cov=./ --cov-report=xml
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# directory: ./coverage/reports/
# env_vars: OS,PYTHON
# fail_ci_if_error: true
# files: ./coverage.xml,
# flags: unittests
# name: codecov-umbrella
# path_to_write_report: ./coverage/codecov_report.txt
# verbose: true