@@ -10,18 +10,63 @@ jobs:
1010 check :
1111 runs-on : ubuntu-22.04
1212
13+ services :
14+ postgres :
15+ image : postgis/postgis
16+ env :
17+ POSTGRES_USER : geoengine
18+ POSTGRES_PASSWORD : geoengine
19+ POSTGRES_DB : geoengine
20+ ports :
21+ - 5432:5432
22+ options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
23+
1324 strategy :
1425 fail-fast : false
1526 matrix :
1627 # use all supported versions from https://devguide.python.org/versions/
1728 python-version : ["3.9", "3.10", "3.11", "3.12"]
1829
30+ defaults :
31+ run :
32+ working-directory : library
33+
1934 steps :
20- - uses : actions/checkout@v3
21- - name : APT update
22- run : sudo apt-get update
23- - name : Install system dependencies
24- run : sudo apt-get install libgeos-dev libproj-dev
35+ - name : Checkout library code
36+ uses : actions/checkout@v4
37+ with :
38+ path : library
39+ - name : Read backend version
40+ id : read-backend-version
41+ run : echo "GEOENGINE_VERSION=$(cat .github/.backend_git_ref)" >> $GITHUB_OUTPUT
42+ - name : Checkout Geo Engine code
43+ uses : actions/checkout@v4
44+ with :
45+ repository : geo-engine/geoengine
46+ ref : ${{ steps.read-backend-version.outputs.GEOENGINE_VERSION }}
47+ path : backend
48+ - name : Free Disk Space (Ubuntu)
49+ uses : jlumbroso/free-disk-space@main
50+ with :
51+ tool-cache : true
52+ android : true
53+ dotnet : true
54+ haskell : true
55+ large-packages : true
56+ docker-images : true
57+ swap-storage : true
58+ - name : Install lld & GDAL & Protobuf
59+ run : |
60+ sudo apt-get update
61+ sudo apt-get install lld libgdal-dev gdal-bin build-essential clang curl protobuf-compiler libgeos-dev libproj-dev
62+ sudo apt-get clean
63+ export C_INCLUDE_PATH=/usr/include/gdal:$C_INCLUDE_PATH
64+ export CPLUS_INCLUDE_PATH=/usr/include/gdal:$CPLUS_INCLUDE_PATH
65+ sudo ldconfig
66+ - name : Install Rustup
67+ run : |
68+ curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y
69+ echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
2570 - name : Set up Python ${{ matrix.python-version }}
2671 uses : actions/setup-python@v4
2772 with :
@@ -53,12 +98,37 @@ jobs:
5398 python -m mypy tests
5499 - name : Test
55100 run : pytest
101+ env :
102+ GEOENGINE_TEST_CODE_PATH : ${{ github.workspace }}/backend
103+ GEOENGINE_TEST_BUILD_TYPE : " release"
104+ - name : Examples
105+ run : |
106+ python -m pip install -e .[examples]
107+ python test_all_notebooks.py
108+ env :
109+ GEOENGINE_TEST_CODE_PATH : ${{ github.workspace }}/backend
110+ GEOENGINE_TEST_BUILD_TYPE : " release"
56111
57112 # Checks the library using minimum version resolution
58113 # `uv` has this feature built-in, c.f. https://github.com/astral-sh/uv
59114 check-min-version :
60115 runs-on : ubuntu-22.04
61116
117+ services :
118+ postgres :
119+ image : postgis/postgis
120+ env :
121+ POSTGRES_USER : geoengine
122+ POSTGRES_PASSWORD : geoengine
123+ POSTGRES_DB : geoengine
124+ ports :
125+ - 5432:5432
126+ options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
127+
128+ defaults :
129+ run :
130+ working-directory : library
131+
62132 env :
63133 # use minimum supported versions from https://devguide.python.org/versions/
64134 python-version : " 3.9"
@@ -67,11 +137,41 @@ jobs:
67137 resolution : " lowest-direct"
68138
69139 steps :
70- - uses : actions/checkout@v3
71- - name : APT update
72- run : sudo apt-get update
73- - name : Install system dependencies
74- run : sudo apt-get install libgeos-dev libproj-dev
140+ - name : Checkout library code
141+ uses : actions/checkout@v4
142+ with :
143+ path : library
144+ - name : Read backend version
145+ id : read-backend-version
146+ run : echo "GEOENGINE_VERSION=$(cat .github/.backend_git_ref)" >> $GITHUB_OUTPUT
147+ - name : Checkout Geo Engine code
148+ uses : actions/checkout@v4
149+ with :
150+ repository : geo-engine/geoengine
151+ ref : ${{ steps.read-backend-version.outputs.GEOENGINE_VERSION }}
152+ path : backend
153+ - name : Free Disk Space (Ubuntu)
154+ uses : jlumbroso/free-disk-space@main
155+ with :
156+ tool-cache : true
157+ android : true
158+ dotnet : true
159+ haskell : true
160+ large-packages : true
161+ docker-images : true
162+ swap-storage : true
163+ - name : Install lld & GDAL & Protobuf
164+ run : |
165+ sudo apt-get update
166+ sudo apt-get install lld libgdal-dev gdal-bin build-essential clang curl protobuf-compiler libgeos-dev libproj-dev
167+ sudo apt-get clean
168+ export C_INCLUDE_PATH=/usr/include/gdal:$C_INCLUDE_PATH
169+ export CPLUS_INCLUDE_PATH=/usr/include/gdal:$CPLUS_INCLUDE_PATH
170+ sudo ldconfig
171+ - name : Install Rustup
172+ run : |
173+ curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y
174+ echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
75175 - name : Set up Python ${{ env.python-version }}
76176 uses : actions/setup-python@v4
77177 with :
@@ -84,17 +184,32 @@ jobs:
84184 uv venv
85185 source .venv/bin/activate
86186
87- uv pip install --resolution=${{ env.resolution}} -e .
88- uv pip install --resolution=${{ env.resolution}} -e .[dev]
187+ uv pip install --resolution=${{ env.resolution }} -e .
188+ uv pip install --resolution=${{ env.resolution }} -e .[dev]
89189 - name : Build
90190 run : |
91191 source .venv/bin/activate
92192 python -m build .
93193 - name : Install test dependencies
94194 run : |
95195 source .venv/bin/activate
96- uv pip install --resolution=${{ env.resolution}} -e .[test]
196+ uv pip install --resolution=${{ env.resolution }} -e .[test]
97197 - name : Test
98198 run : |
99199 source .venv/bin/activate
100- pytest
200+ pytest --cov=geoengine --cov-report=lcov
201+ env :
202+ GEOENGINE_TEST_CODE_PATH : ${{ github.workspace }}/backend
203+ GEOENGINE_TEST_BUILD_TYPE : " release"
204+ - name : Upload coverage to Coveralls
205+ uses : coverallsapp/github-action@v2
206+ with :
207+ base-path : library
208+ - name : Examples
209+ run : |
210+ source .venv/bin/activate
211+ uv pip install --resolution=${{ env.resolution }} -e .[examples]
212+ python test_all_notebooks.py
213+ env :
214+ GEOENGINE_TEST_CODE_PATH : ${{ github.workspace }}/backend
215+ GEOENGINE_TEST_BUILD_TYPE : " release"
0 commit comments