-
Notifications
You must be signed in to change notification settings - Fork 13
53 lines (48 loc) · 1.44 KB
/
unittest.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
name: Unittest
on:
push:
branches:
- master
- release/*
pull_request:
branches:
- master
jobs:
test:
name: Test on python ${{ matrix.python-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-20.04, windows-2019, macos-13]
exclude:
- os: macos-13
python-version: '3.7'
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo python -m pip install --upgrade pip pytest pytest-cov pytest-tornasync codecov
sudo python -m pip install -r requirements.txt
else
python -m pip install --upgrade pip pytest pytest-cov pytest-tornasync codecov
python -m pip install -r requirements.txt
fi
shell: bash
- name: Run Tests
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo python -m pytest --cov=.
else
python -m pytest --cov=.
fi
shell: bash
- name: Upload coverage reports to Codecov
run: |
codecov -t ${{ secrets.CODECOV_TOKEN }}