generated from joshuaspear/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (48 loc) · 1.56 KB
/
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
48
49
50
name: test
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Setup
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies for Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
python -m pip install --upgrade pip
pip install numpy Cython pytest-cov
pip install -r requirements.txt
pip install .
- name: Install dependencies for macOS
if: ${{ matrix.os == 'macos-latest' }}
run: |
python -m pip install --upgrade pip
pip install numpy Cython pytest-cov
pip install -r requirements.txt
pip install .
- name: Install dependencies for ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
python -m pip install --upgrade pip
pip install numpy Cython pytest-cov
pip install -r requirements.txt
pip install .
- name: Unit tests
run: |
mkdir -p test_data
pytest --cov-report=xml --cov-config=.coveragerc tests -p no:warnings -v