2021-07-05 01:29:51 +03:00
|
|
|
name: tests
|
2021-06-17 23:50:17 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- '**.py'
|
2021-07-05 01:29:51 +03:00
|
|
|
- 'pyproject.toml'
|
2021-06-17 23:50:17 +03:00
|
|
|
- 'requirements.txt'
|
2021-07-06 19:37:18 +03:00
|
|
|
- '.github/workflows/tests.yaml'
|
2021-06-17 23:50:17 +03:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- '**.py'
|
2021-07-05 01:29:51 +03:00
|
|
|
- 'pyproject.toml'
|
2021-06-17 23:50:17 +03:00
|
|
|
- 'requirements.txt'
|
2021-07-06 19:37:18 +03:00
|
|
|
- '.github/workflows/tests.yaml'
|
2021-06-17 23:50:17 +03:00
|
|
|
jobs:
|
2021-07-05 01:29:51 +03:00
|
|
|
mypy:
|
|
|
|
name: mypy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Clone repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.9
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
pip install cython numpy # needed for pycocotools
|
2021-07-06 21:58:43 +03:00
|
|
|
pip install --pre -r requirements.txt
|
2021-07-05 01:29:51 +03:00
|
|
|
- name: Run mypy checks
|
|
|
|
run: mypy .
|
2021-06-17 23:50:17 +03:00
|
|
|
pytest:
|
|
|
|
name: pytest
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2021-06-18 00:05:26 +03:00
|
|
|
python-version: [3.6, 3.7, 3.8, 3.9]
|
2021-06-17 23:50:17 +03:00
|
|
|
steps:
|
|
|
|
- name: Clone repo
|
|
|
|
uses: actions/checkout@v2
|
2021-06-22 02:04:40 +03:00
|
|
|
- name: Set up python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2021-07-30 17:44:58 +03:00
|
|
|
- name: Install apt dependencies (Linux)
|
2021-07-27 20:19:50 +03:00
|
|
|
run: sudo apt-get install unrar
|
2021-06-22 18:50:39 +03:00
|
|
|
if: ${{ runner.os == 'Linux' }}
|
2021-07-30 17:44:58 +03:00
|
|
|
- name: Install brew dependencies (macOS)
|
2021-07-27 20:19:50 +03:00
|
|
|
run: brew install rar
|
2021-06-22 18:57:21 +03:00
|
|
|
if: ${{ runner.os == 'macOS' }}
|
2021-07-30 17:44:58 +03:00
|
|
|
- name: Install conda (Windows)
|
2021-07-30 03:00:46 +03:00
|
|
|
uses: conda-incubator/setup-miniconda@v2
|
2021-07-20 23:15:30 +03:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2021-07-30 18:06:35 +03:00
|
|
|
channels: conda-forge,defaults
|
2021-07-20 23:15:30 +03:00
|
|
|
if: ${{ runner.os == 'Windows' }}
|
2021-07-30 17:44:58 +03:00
|
|
|
- name: Install conda dependencies (Windows)
|
2021-07-30 18:21:36 +03:00
|
|
|
run: conda install 'rasterio>=1.0' h5py
|
2021-06-22 18:47:01 +03:00
|
|
|
if: ${{ runner.os == 'Windows' }}
|
2021-06-22 18:29:01 +03:00
|
|
|
- name: Install pip dependencies
|
2021-06-18 00:12:48 +03:00
|
|
|
run: |
|
2021-07-30 17:44:58 +03:00
|
|
|
pip install cython numpy # needed for pycocotools
|
|
|
|
pip install --pre -r requirements.txt
|
2021-06-17 23:50:17 +03:00
|
|
|
- name: Run pytest checks
|
2021-07-30 17:44:58 +03:00
|
|
|
run: pytest --cov=. --cov-report=term-missing
|