-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (44 loc) · 1.23 KB
/
codecov.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
name: CodeCov
on:
push: # all pushes
pull_request:
branches: ["main", "dev"]
jobs:
run:
runs-on: ubuntu-latest
env:
OS: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11.7
cache: 'pip' # caching pip dependencies
- name: Install requirements
run: |
pip install --upgrade pip
pip install -r requirements.txt
pip install coverage
pip install coverage[toml]
pip install -e .
- name: pre-commit
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # sha for v4.0.2
with:
path: ~/.cache/pre-commit/
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: |
pre-commit install
pre-commit run --show-diff-on-failure --color=always --all-files
- name: Generate Report
run: |
coverage run -m pytest
coverage xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
verbose: true
token: ${{secrets.CODECOV_TOKEN}}