-
-
Notifications
You must be signed in to change notification settings - Fork 9
56 lines (56 loc) · 1.57 KB
/
unit-tests.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
name: Unit tests
on:
push:
branches: [ development, main ]
pull_request:
branches: [ development ]
schedule:
- cron: '0 0 * * 5'
jobs:
unit-tests:
name: "Run Unit Tests"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: 'poetry'
- name: Install dependencies
run: poetry install
- name: Run unit tests
run: >
poetry run pytest
--junit-xml="output/unit-tests.xml"
--cov
--cov-report="xml:output/coverage.xml"
--cov-report="html:output/htmlcov"
- name: Publish test results
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.os }}-${{ matrix.python }}
path: output/**
- name: Upload to Codecov.io
if: success() || failure()
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: output/coverage.xml
flags: unittests
status:
if: ${{ always() }}
runs-on: ubuntu-latest
name: "Unit Test Status"
needs: unit-tests
steps:
- name: Check test matrix status
if: ${{ needs.unit-tests.result != 'success' }}
run: exit 1