-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (54 loc) · 1.6 KB
/
coverage.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
name: Coverage
on: [workflow_call]
jobs:
run:
name: Coverage
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
python-version: ["3.10"]
poetry-version: ["1.1.13"]
os: [ubuntu-latest]
include:
- os: ubuntu-latest
poetry-cache: ~/.cache/pypoetry
steps:
- name: Checkout
uses: actions/checkout@v3
# Need to install libsndfile for linux
- name: System Dependencies
run: sudo apt-get install libsndfile1
if: matrix.os == 'ubuntu-latest'
- name: Cache Poetry
uses: actions/cache@v2
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ matrix.os }}-${{ matrix.poetry-cache }}-${{ matrix.python-version }}-${{ matrix.poetry-version }}
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Run Poetry image
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install requirements
run: |
poetry install
- name: Run Tests
run: |
poetry run pytest --cov=./src --cov-report=xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3.1.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: unittests
verbose: true
- name: Upload Coverage to DeepSource
uses: deepsourcelabs/test-coverage-action@master
with:
key: python
coverage-file: coverage.xml
dsn: ${{ secrets.DEEPSOURCE_DSN }}