-
Notifications
You must be signed in to change notification settings - Fork 12
86 lines (69 loc) · 2.16 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Unit test on push and PR
on:
push:
branches:
- main
- development
pull_request:
branches:
- main
- development
workflow_dispatch:
jobs:
unit-tests:
name: Run Unit Tests
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
env:
OS: ${{ matrix.os }}
PYTHON-VERSION: ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Checkout code
uses: actions/checkout@v3
- name: Get pip cache location
id: pip-cache
shell: bash
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Get date
id: date
shell: bash
run: >
python -c
"import datetime;
now = datetime.datetime.now();
print(f'text={now.year}/{now.month}-part{1 + now.day // 8}')" >> $GITHUB_OUTPUT
- name: Load pip Cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-Python${{ matrix.python-version }}-${{ steps.date.outputs.text }}-pip-${{ hashFiles('**/setup.py', './.github/workflows/unit-tests.yml') }}
- name: Install package & (test) dependencies
run: python -m pip install --upgrade --upgrade-strategy=eager .[test]
- name: Run Tests
run: >
python -m pytest tests
--cov=endaq
--cov-report=xml
--hypothesis-profile=ci
--numprocesses auto
-W error::RuntimeWarning
-W error::UserWarning
-W error::DeprecationWarning
- name: Generate Codecov Report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON-VERSION
files: ./coverage.xml
name: ${{ matrix.os }} ${{ matrix.python-version }}
verbose: true