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: |
|
2021-07-20 23:06:58 +03:00
|
|
|
sudo apt-get install libgeos-dev libproj-dev # needed for cartopy
|
2021-07-05 01:29:51 +03:00
|
|
|
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 }}
|
2021-07-21 01:23:52 +03:00
|
|
|
env:
|
|
|
|
PKG_CONFIG_PATH: /usr/local/opt/proj@7/lib/pkgconfig
|
2021-06-17 23:50:17 +03:00
|
|
|
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-06-22 01:51:46 +03:00
|
|
|
- name: Cache dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
2021-06-22 18:57:21 +03:00
|
|
|
# All OSes
|
2021-06-22 01:51:46 +03:00
|
|
|
~/conda_pkgs_dir
|
2021-06-22 18:57:21 +03:00
|
|
|
# Linux
|
|
|
|
~/.cache/pip
|
|
|
|
/var/cache/apt/archives
|
|
|
|
# macOS
|
|
|
|
~/Library/Caches/pip
|
|
|
|
~/Library/Caches/Homebrew
|
|
|
|
# Windows
|
|
|
|
~\AppData\Local\pip\Cache
|
2021-06-22 01:51:46 +03:00
|
|
|
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
|
2021-06-22 02:15:37 +03:00
|
|
|
restore-keys: ${{ runner.os }}-python-${{ matrix.python-version }}-
|
2021-06-22 18:50:39 +03:00
|
|
|
- name: Install apt dependencies
|
2021-07-20 23:06:58 +03:00
|
|
|
run: sudo apt-get install libgeos-dev libproj-dev unrar
|
2021-06-22 18:50:39 +03:00
|
|
|
if: ${{ runner.os == 'Linux' }}
|
2021-06-22 18:57:21 +03:00
|
|
|
- name: Install brew dependencies
|
2021-07-21 01:10:49 +03:00
|
|
|
run: brew install geos proj@7 rar
|
2021-06-22 18:57:21 +03:00
|
|
|
if: ${{ runner.os == 'macOS' }}
|
2021-07-20 23:15:30 +03:00
|
|
|
- name: Install conda
|
|
|
|
uses: conda-incubator/setup-miniconda@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
if: ${{ runner.os == 'Windows' }}
|
2021-06-22 18:29:01 +03:00
|
|
|
- name: Install conda dependencies
|
2021-07-20 23:52:24 +03:00
|
|
|
run: conda install -c conda-forge cartopy h5py 'rasterio>=1.0'
|
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-06-18 00:31:59 +03:00
|
|
|
pip install cython numpy # needed for pycocotools
|
2021-07-06 21:58:43 +03:00
|
|
|
pip install --pre -r requirements.txt
|
2021-06-17 23:50:17 +03:00
|
|
|
- name: Run pytest checks
|
2021-06-22 02:52:58 +03:00
|
|
|
run: pytest --cov=. --cov-report=term-missing
|