Files
geopandas/.github/workflows/tests.yaml
T
Martin Fleischmann 7e595d08a5 DOC/CI: remove Travis from docs and paths (#1632)
* DOC/CI: remove Travis from docs and paths

* use envs

* fix

* typo

* how to trigger check
2020-10-10 20:03:25 +01:00

131 lines
3.9 KiB
YAML

name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 0 * * *'
jobs:
Linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.0
Test:
needs: Linting
name: ${{ matrix.os }}, ${{ matrix.env }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
postgis: [false]
dev: [false]
env:
- ci/envs/36-minimal.yaml
- ci/envs/38-no-optional-deps.yaml
- ci/envs/36-pd025.yaml
- ci/envs/37-latest-defaults.yaml
- ci/envs/37-latest-conda-forge.yaml
- ci/envs/38-latest-conda-forge.yaml
include:
- env: ci/envs/37-latest-conda-forge.yaml
os: macos-latest
postgis: false
dev: false
- env: ci/envs/38-latest-conda-forge.yaml
os: macos-latest
postgis: false
dev: false
- env: ci/envs/37-latest-conda-forge.yaml
os: windows-latest
postgis: false
dev: false
- env: ci/envs/38-latest-conda-forge.yaml
os: windows-latest
postgis: false
dev: false
- env: ci/envs/37-dev.yaml
os: ubuntu-latest
dev: true
steps:
- uses: actions/checkout@v2
- name: Setup Conda
uses: s-weigand/setup-conda@v1.0.4
with:
activate-conda: false
- name: Install Env
shell: bash
run: conda env create -f ${{ matrix.env }}
- name: Check and Log Environment
shell: bash
run: |
source activate test
python -V
python -c "import geopandas; geopandas.show_versions();"
conda info
# save conda list to file and print out
# so that we can do the HAS_PYGEOS check without calling conda again
conda list 2>&1 | tee conda.txt
if ( cat conda.txt | grep -q pygeos )
then
echo "Setting HAS_PYGEOS=1"
echo '::set-env name=HAS_PYGEOS::1'
else
echo "Setting HAS_PYGEOS=0"
echo '::set-env name=HAS_PYGEOS::0'
fi
- name: Test without PyGEOS
shell: bash
continue-on-error: ${{ matrix.dev }}
env:
USE_PYGEOS: 0
run: |
source activate test
pytest -v -r s -n auto --color=yes --cov=geopandas --cov-append --cov-report term-missing --cov-report xml geopandas/
- name: Test with PyGEOS
shell: bash
continue-on-error: ${{ matrix.dev }}
if: env.HAS_PYGEOS == 1
env:
USE_PYGEOS: 1
run: |
source activate test
pytest -v -r s -n auto --color=yes --cov=geopandas --cov-append --cov-report term-missing --cov-report xml geopandas/
- name: Test with PostGIS
shell: bash
if: contains(matrix.env, '38-latest-conda-forge.yaml') && contains(matrix.os, 'ubuntu')
env:
PGUSER: postgres
PGPASSWORD: postgres
PGHOST: "127.0.0.1"
run: |
source activate test
conda install postgis -c conda-forge
source ci/envs/setup_postgres.sh
pytest -v -r s --color=yes --cov=geopandas --cov-append --cov-report term-missing --cov-report xml geopandas/io/tests/test_sql.py | tee /dev/stderr | if grep SKIPPED >/dev/null;then echo "TESTS SKIPPED, FAILING" && exit 1;fi
- name: Test docstrings
shell: bash
if: contains(matrix.env, '38-latest-conda-forge.yaml') && contains(matrix.os, 'ubuntu')
env:
USE_PYGEOS: 1
run: |
source activate test
pytest -v --color=yes --doctest-only geopandas --ignore=geopandas/datasets
- uses: codecov/codecov-action@v1