1
- name : Workflow for Codecov example-python
2
- on : [push, pull_request ]
1
+ name : workflow for Codecov
2
+ on : [push]
3
3
jobs :
4
4
run :
5
- runs-on : ubuntu-latest
5
+ runs-on : ${{ matrix.os }}
6
+ strategy :
7
+ matrix :
8
+ os : [ubuntu-latest, macos-latest, windows-latest]
9
+ env :
10
+ OS : ${{ matrix.os }}
11
+ PYTHON : ' 3.10'
6
12
steps :
7
- - name : Checkout
8
- uses : actions/checkout@v4
9
- with :
10
- fetch-depth : 0
11
- - name : Set up Python 3.10
12
- uses : actions/setup-python@v4
13
- with :
14
- python-version : ' 3.10'
15
- - name : Install dependencies
16
- run : pip install -r requirements.txt
17
- - name : Run ATS
18
- uses : codecov/codecov-ats@v0
19
- env :
20
- CODECOV_STATIC_TOKEN : ${{ secrets.CODECOV_STATIC_TOKEN }}
21
- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
22
- - name : Run tests and collect coverage
23
- run : pytest --cov app ${{ env.CODECOV_ATS_TESTS }}
24
- - name : Upload coverage to Codecov
25
- uses : codecov/codecov-action@v4
26
- with :
27
- flags : smart-tests
28
- verbose : true
29
- env :
30
- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
13
+ - uses : actions/checkout@main
14
+ - name : Setup Python
15
+ uses : actions/setup-python@main
16
+ with :
17
+ python-version : 3.10
18
+ - name : Generate coverage report
19
+ run : |
20
+ pip install pytest
21
+ pip install pytest-cov
22
+ pytest --cov=./ --cov-report=xml
23
+ - name : Upload coverage to Codecov
24
+ uses : codecov/codecov-action@v4
25
+ with :
26
+ directory : ./coverage/reports/
27
+ env_vars : OS,PYTHON
28
+ fail_ci_if_error : true
29
+ flags : unittests
30
+ name : codecov-umbrella
31
+ token : ${{ secrets.CODECOV_TOKEN }}
32
+ verbose : true
0 commit comments