Skip to content

Commit

Permalink
Merge pull request #203 from knaaptime/infrastructure
Browse files Browse the repository at this point in the history
infrastructure
  • Loading branch information
knaaptime authored Feb 16, 2024
2 parents 185123f + b9a7cb5 commit 704d7dd
Show file tree
Hide file tree
Showing 15 changed files with 161 additions and 754 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
strategy:
matrix:
os: ['ubuntu-latest']
environment-file: [.ci/39.yml]
environment-file: [ci/311.yml]
experimental: [false]
defaults:
run:
Expand Down
92 changes: 64 additions & 28 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Unit Tests
name: Continuous Integration

on:
push:
branches:
Expand All @@ -8,52 +9,87 @@
- '*'
schedule:
- cron: '59 23 * * *'
workflow_dispatch:
inputs:
version:
description: Manual CI Run
default: test
required: false

jobs:
unittests:
name: CI (${{ matrix.os }}-${{ matrix.environment-file }})
tests:
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
runs-on: ${{ matrix.os }}
continue-on-error: false
timeout-minutes: 45
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
environment-file: [ .ci/39.yml, .ci/310.yml, .ci/311.yml]
os: [ubuntu-latest]
environment-file: [
ci/310.yml,
ci/311.yml,
ci/312.yml,
]
include:
- environment-file: ci/312.yml
os: macos-latest
- environment-file: ci/312.yml
os: macos-14 # Apple Silicon
- environment-file: ci/312.yml
os: windows-latest
fail-fast: false

defaults:
run:
shell: bash -l {0}

steps:
- name: checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: setup micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ matrix.environment-file }}
micromamba-version: 'latest'

- name: reinstall tobler - bash
shell: bash -l {0}
run: pip install -e . --no-deps --force-reinstall
if: matrix.os != 'windows-latest'

- name: reinstall tobler - powershell
shell: powershell
run: pip install -e . --no-deps --force-reinstall
if: matrix.os == 'windows-latest'

- name: environment info
run: |
micromamba info
micromamba list
- name: run pytest - bash
shell: bash -l {0}
run: pytest -v tobler --cov=tobler --cov-report=xml
if: matrix.os != 'windows-latest'
- name: spatial versions
run: 'python -c "import geopandas; geopandas.show_versions();"'

- name: install package
run: 'pip install . --no-deps'

- name: run pytest - powershell
shell: powershell
run: pytest -v tobler --cov=tobler --cov-report=xml
if: matrix.os == 'windows-latest'
- name: run tests
run: |
pytest tobler \
-v \
-r a \
-n auto \
--color yes \
--cov tobler \
--cov-append \
--cov-report term-missing \
--cov-report xml
- name: codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
name: tobler-codecov

- name: Generate and publish the report
if: |
failure()
&& steps.status.outcome == 'failure'
&& github.event_name == 'schedule'
&& github.repository_owner == 'pysal'
uses: xarray-contrib/issue-from-pytest-log@v1
with:
log-path: pytest-log.jsonl
4 changes: 2 additions & 2 deletions .ci/310.yml → ci/310.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ dependencies:
- python=3.10
- dask
- dask-geopandas
- distributed
- jupyterlab
- numpy
- geopandas
Expand All @@ -19,10 +18,11 @@ dependencies:
- libpysal
- tqdm
- codecov
- quilt3
- pytest
- pytest-mpl
- pytest-cov
- pytest-xdist
- coverage
- twine
- pip
- h3-py
Expand Down
12 changes: 10 additions & 2 deletions .ci/311.yml → ci/311.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ dependencies:
- jupyterlab
- dask
- dask-geopandas
- distributed
- numpy
- geopandas
- pandas
Expand All @@ -20,11 +19,20 @@ dependencies:
- tqdm
- codecov
- pytest
- quilt3
- pytest-mpl
- pytest-cov
- pytest-xdist
- coverage
- twine
- pip
- h3-py
- joblib
- astropy
- mapclassify
- sphinx>=1.4.3
- sphinxcontrib-bibtex==1.0.0
- sphinx_bootstrap_theme
- numpydoc
- nbsphinx
- joblib
- astropy
7 changes: 3 additions & 4 deletions .ci/39.yml → ci/312.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ name: test
channels:
- conda-forge
dependencies:
- python=3.9
- python=3.12
- dask
- dask-geopandas
- distributed
- numpy
- geopandas
- pandas
Expand All @@ -17,15 +16,15 @@ dependencies:
- libpysal
- tqdm
- codecov
- pytest-xdist
- coverage
- pytest
- quilt3
- pytest-mpl
- pytest-cov
- twine
- pip
- h3-py
- mapclassify
- descartes
- sphinx>=1.4.3
- sphinxcontrib-bibtex==1.0.0
- sphinx_bootstrap_theme
Expand Down
20 changes: 20 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
codecov:
notify:
after_n_builds: 7
coverage:
range: 50..95
round: nearest
precision: 1
status:
project:
default:
threshold: 15%
patch:
default:
threshold: 20%
target: 60%
comment:
layout: "reach, diff, files"
behavior: once
after_n_builds: 7
require_changes: true
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ channels:
dependencies:
- dask-geopandas
- dask
- distributed
- jupyterlab
- numpy
- geopandas >=0.13
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ tests = [
"pytest",
"pytest-mpl",
"pytest-cov",
"pytest-xdist",
"watermark",
"h3",
"astropy"
Expand Down
Loading

0 comments on commit 704d7dd

Please sign in to comment.