Skip to content

Commit 704d7dd

Browse files
authored
Merge pull request #203 from knaaptime/infrastructure
infrastructure
2 parents 185123f + b9a7cb5 commit 704d7dd

15 files changed

+161
-754
lines changed

.github/workflows/build_docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
strategy:
1414
matrix:
1515
os: ['ubuntu-latest']
16-
environment-file: [.ci/39.yml]
16+
environment-file: [ci/311.yml]
1717
experimental: [false]
1818
defaults:
1919
run:

.github/workflows/unittests.yml

+64-28
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Unit Tests
1+
name: Continuous Integration
2+
23
on:
34
push:
45
branches:
@@ -8,52 +9,87 @@
89
- '*'
910
schedule:
1011
- cron: '59 23 * * *'
12+
workflow_dispatch:
13+
inputs:
14+
version:
15+
description: Manual CI Run
16+
default: test
17+
required: false
1118

1219
jobs:
13-
unittests:
14-
name: CI (${{ matrix.os }}-${{ matrix.environment-file }})
20+
tests:
21+
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
1522
runs-on: ${{ matrix.os }}
16-
continue-on-error: false
17-
timeout-minutes: 45
23+
timeout-minutes: 30
1824
strategy:
1925
matrix:
20-
os: [ubuntu-latest, macos-latest, windows-latest]
21-
environment-file: [ .ci/39.yml, .ci/310.yml, .ci/311.yml]
26+
os: [ubuntu-latest]
27+
environment-file: [
28+
ci/310.yml,
29+
ci/311.yml,
30+
ci/312.yml,
31+
]
32+
include:
33+
- environment-file: ci/312.yml
34+
os: macos-latest
35+
- environment-file: ci/312.yml
36+
os: macos-14 # Apple Silicon
37+
- environment-file: ci/312.yml
38+
os: windows-latest
2239
fail-fast: false
2340

41+
defaults:
42+
run:
43+
shell: bash -l {0}
44+
2445
steps:
2546
- name: checkout repo
26-
uses: actions/checkout@v2
47+
uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0 # Fetch all history for all branches and tags.
2750

2851
- name: setup micromamba
29-
uses: mamba-org/provision-with-micromamba@main
52+
uses: mamba-org/setup-micromamba@v1
3053
with:
3154
environment-file: ${{ matrix.environment-file }}
3255
micromamba-version: 'latest'
33-
34-
- name: reinstall tobler - bash
35-
shell: bash -l {0}
36-
run: pip install -e . --no-deps --force-reinstall
37-
if: matrix.os != 'windows-latest'
38-
39-
- name: reinstall tobler - powershell
40-
shell: powershell
41-
run: pip install -e . --no-deps --force-reinstall
42-
if: matrix.os == 'windows-latest'
56+
57+
- name: environment info
58+
run: |
59+
micromamba info
60+
micromamba list
4361
44-
- name: run pytest - bash
45-
shell: bash -l {0}
46-
run: pytest -v tobler --cov=tobler --cov-report=xml
47-
if: matrix.os != 'windows-latest'
62+
- name: spatial versions
63+
run: 'python -c "import geopandas; geopandas.show_versions();"'
64+
65+
- name: install package
66+
run: 'pip install . --no-deps'
4867

49-
- name: run pytest - powershell
50-
shell: powershell
51-
run: pytest -v tobler --cov=tobler --cov-report=xml
52-
if: matrix.os == 'windows-latest'
68+
- name: run tests
69+
run: |
70+
pytest tobler \
71+
-v \
72+
-r a \
73+
-n auto \
74+
--color yes \
75+
--cov tobler \
76+
--cov-append \
77+
--cov-report term-missing \
78+
--cov-report xml
5379
5480
- name: codecov
55-
uses: codecov/codecov-action@v1
81+
uses: codecov/codecov-action@v3
5682
with:
5783
token: ${{ secrets.CODECOV_TOKEN }}
5884
file: ./coverage.xml
5985
name: tobler-codecov
86+
87+
- name: Generate and publish the report
88+
if: |
89+
failure()
90+
&& steps.status.outcome == 'failure'
91+
&& github.event_name == 'schedule'
92+
&& github.repository_owner == 'pysal'
93+
uses: xarray-contrib/issue-from-pytest-log@v1
94+
with:
95+
log-path: pytest-log.jsonl

.ci/310.yml ci/310.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ dependencies:
55
- python=3.10
66
- dask
77
- dask-geopandas
8-
- distributed
98
- jupyterlab
109
- numpy
1110
- geopandas
@@ -19,10 +18,11 @@ dependencies:
1918
- libpysal
2019
- tqdm
2120
- codecov
22-
- quilt3
2321
- pytest
2422
- pytest-mpl
2523
- pytest-cov
24+
- pytest-xdist
25+
- coverage
2626
- twine
2727
- pip
2828
- h3-py

.ci/311.yml ci/311.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ dependencies:
66
- jupyterlab
77
- dask
88
- dask-geopandas
9-
- distributed
109
- numpy
1110
- geopandas
1211
- pandas
@@ -20,11 +19,20 @@ dependencies:
2019
- tqdm
2120
- codecov
2221
- pytest
23-
- quilt3
2422
- pytest-mpl
2523
- pytest-cov
24+
- pytest-xdist
25+
- coverage
2626
- twine
2727
- pip
2828
- h3-py
2929
- joblib
3030
- astropy
31+
- mapclassify
32+
- sphinx>=1.4.3
33+
- sphinxcontrib-bibtex==1.0.0
34+
- sphinx_bootstrap_theme
35+
- numpydoc
36+
- nbsphinx
37+
- joblib
38+
- astropy

.ci/39.yml ci/312.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ name: test
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.9
5+
- python=3.12
66
- dask
77
- dask-geopandas
8-
- distributed
98
- numpy
109
- geopandas
1110
- pandas
@@ -17,15 +16,15 @@ dependencies:
1716
- libpysal
1817
- tqdm
1918
- codecov
19+
- pytest-xdist
20+
- coverage
2021
- pytest
21-
- quilt3
2222
- pytest-mpl
2323
- pytest-cov
2424
- twine
2525
- pip
2626
- h3-py
2727
- mapclassify
28-
- descartes
2928
- sphinx>=1.4.3
3029
- sphinxcontrib-bibtex==1.0.0
3130
- sphinx_bootstrap_theme

codecov.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
codecov:
2+
notify:
3+
after_n_builds: 7
4+
coverage:
5+
range: 50..95
6+
round: nearest
7+
precision: 1
8+
status:
9+
project:
10+
default:
11+
threshold: 15%
12+
patch:
13+
default:
14+
threshold: 20%
15+
target: 60%
16+
comment:
17+
layout: "reach, diff, files"
18+
behavior: once
19+
after_n_builds: 7
20+
require_changes: true

environment.yml

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ channels:
44
dependencies:
55
- dask-geopandas
66
- dask
7-
- distributed
87
- jupyterlab
98
- numpy
109
- geopandas >=0.13

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ tests = [
6464
"pytest",
6565
"pytest-mpl",
6666
"pytest-cov",
67+
"pytest-xdist",
6768
"watermark",
6869
"h3",
6970
"astropy"

0 commit comments

Comments
 (0)