зеркало из https://github.com/microsoft/torchgeo.git
72 строки
2.1 KiB
YAML
72 строки
2.1 KiB
YAML
name: tests
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
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
|
|
run: |
|
|
# TODO: remove after kornia's next release (>0.5.11)
|
|
pip install git+https://github.com/kornia/kornia@master # required for mypy fixes
|
|
pip install cython numpy # needed for pycocotools
|
|
pip install .[datasets,tests,train]
|
|
- name: Run mypy checks
|
|
run: mypy .
|
|
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
|
|
steps:
|
|
- name: Clone repo
|
|
uses: actions/checkout@v2
|
|
- name: Set up python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install apt dependencies (Linux)
|
|
run: sudo apt-get install unrar
|
|
if: ${{ runner.os == 'Linux' }}
|
|
- name: Install brew dependencies (macOS)
|
|
run: brew install rar
|
|
if: ${{ runner.os == 'macOS' }}
|
|
- name: Install conda (Windows)
|
|
uses: conda-incubator/setup-miniconda@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
channels: conda-forge
|
|
channel-priority: strict
|
|
if: ${{ runner.os == 'Windows' }}
|
|
- name: Install conda dependencies (Windows)
|
|
run: |
|
|
conda install 'fiona>=1.5' h5py 'rasterio>=1.0.16'
|
|
conda list
|
|
conda info
|
|
if: ${{ runner.os == 'Windows' }}
|
|
- name: Install pip dependencies
|
|
run: |
|
|
pip install cython numpy # needed for pycocotools
|
|
pip install .[datasets,tests,train]
|
|
- name: Run pytest checks
|
|
run: pytest --cov=torchgeo --cov-report=xml
|
|
- name: Report coverage
|
|
uses: codecov/codecov-action@v2
|