Use poetry install in CI tests #35
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
- 'docs/**' | |
- '.gitignore' | |
- '.pre-commit-config.yaml' | |
- 'Makefile' | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] | |
python-version: ['3.6', '3.7', '3.8'] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.os }} - python ${{ matrix.python-version }} | |
env: | |
coverage: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Install poetry | |
uses: snok/install-poetry@v1 | |
- name: Install conda environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-name: test | |
create-args: >- | |
python=${{ matrix.python-version }} | |
gdal=3.2.0 | |
- name: Install dependencies | |
shell: bash -l {0} | |
run: | | |
conda activate test | |
poetry install --no-interaction --all-extras | |
- name: Lint | |
shell: bash -l {0} | |
run: | | |
conda activate test | |
flake8 src tests | |
- name: Test | |
if: env.coverage == 'false' | |
shell: bash -l {0} | |
run: | | |
conda activate test | |
pytest --doctest-modules src tests | |
env: | |
MPLBACKEND: agg | |
- name: Test with coverage | |
if: env.coverage == 'true' | |
shell: bash -l {0} | |
run: | | |
conda activate test | |
pytest --cov --doctest-modules src tests | |
env: | |
MPLBACKEND: agg | |
- name: Upload coverage to Codecov | |
if: env.coverage == 'true' | |
shell: bash -l {0} | |
run: | | |
conda activate test | |
coverage xml --fail-under=0 | |
codecov | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |