-
Notifications
You must be signed in to change notification settings - Fork 4
47 lines (45 loc) · 1.47 KB
/
unit_test.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
name: Python Unit Tests
on:
pull_request:
branches:
- main
- 'release/**'
jobs:
build:
name: Run Python Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r utils/requirements.txt
- name: Test with pytest
run: |
pip install pytest
pip install pytest-cov
pip install uuid
pytest utils/tests --doctest-modules --junitxml=junit/test-results.xml --cov=utils/functions --cov-report=xml:junit/coverage.xml
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
if: success() || failure()
with:
pytest-xml-coverage-path: junit/coverage.xml
unique-id-for-comment: ${{ matrix.python-version }}
title: Test Coverage Report - Python ${{ matrix.python-version }}
badge-title: Test Coverage
hide-badge: false
hide-report: false
create-new-comment: false
hide-comment: false
report-only-changed-files: false
remove-link-from-badge: false
junitxml-path: junit/test-results.xml
junitxml-title: Python ${{ matrix.python-version }} Test Results