torchgeo/.github/workflows/tests.yaml

72 строки
2.1 KiB
YAML
Исходник Постоянная ссылка Обычный вид История

2021-07-05 01:29:51 +03:00
name: tests
2021-06-17 23:50:17 +03:00
on:
push:
branches:
- main
pull_request:
branches:
- main
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 pip dependencies
2021-07-05 01:29:51 +03:00
run: |
# TODO: remove after kornia's next release (>0.5.11)
pip install git+https://github.com/kornia/kornia@master # required for mypy fixes
2021-07-05 01:29:51 +03:00
pip install cython numpy # needed for pycocotools
pip install .[datasets,tests,train]
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]
python-version: [3.6, 3.7, 3.8, 3.9]
exclude:
- os: windows-latest
python-version: 3.6
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)
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)
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:29:38 +03:00
channels: conda-forge
2021-07-30 18:53:32 +03:00
channel-priority: strict
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:29:38 +03:00
run: |
conda install 'fiona>=1.5' h5py 'rasterio>=1.0.16'
2021-07-30 18:29:38 +03:00
conda list
conda info
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 .[datasets,tests,train]
2021-06-17 23:50:17 +03:00
- name: Run pytest checks
2021-09-04 00:03:55 +03:00
run: pytest --cov=torchgeo --cov-report=xml
- name: Report coverage
uses: codecov/codecov-action@v2