@@ -3,213 +3,34 @@ name: CI
33on :
44 pull_request :
55 merge_group :
6+ # Creates a coverage of the main branch
7+ push :
8+ branches :
9+ - main
610 # Allows you to run this workflow manually from the Actions tab
711 workflow_dispatch :
812
913jobs :
1014 check :
11- runs-on : ubuntu-22.04
12-
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
15+ uses : geo-engine/geoengine-python/.github/workflows/test-python.yml@reusable-workflow
2316
2417 strategy :
2518 fail-fast : false
2619 matrix :
2720 # use all supported versions from https://devguide.python.org/versions/
2821 python-version : ["3.9", "3.10", "3.11", "3.12"]
2922
30- defaults :
31- run :
32- working-directory : library
33-
34- steps :
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
70- - name : Set up Python ${{ matrix.python-version }}
71- uses : actions/setup-python@v4
72- with :
73- python-version : ${{ matrix.python-version }}
74- - name : Install build dependencies
75- run : |
76- python -m pip install --upgrade pip
77- pip install -e .
78- pip install -e .[dev]
79- - name : Check Formatting
80- run : |
81- python -m pycodestyle
82- - name : Lint code
83- run : |
84- python -m pylint geoengine
85- - name : Type-check code
86- run : |
87- python -m mypy geoengine
88- - name : Build
89- run : python -m build .
90- - name : Install test dependencies
91- run : |
92- pip install -e .[test]
93- - name : Lint tests
94- run : |
95- python -m pylint tests
96- - name : Type-check tests
97- run : |
98- python -m mypy tests
99- - name : Test
100- 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"
23+ with :
24+ python-version : ${{ matrix.python-version }}
25+ use-uv : false
26+ coverage : false
11127
11228 # Checks the library using minimum version resolution
11329 # `uv` has this feature built-in, c.f. https://github.com/astral-sh/uv
11430 check-min-version :
115- runs-on : ubuntu-22.04
116-
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-
132- env :
133- # use minimum supported versions from https://devguide.python.org/versions/
134- python-version : " 3.9"
135- # lowest compatible versions for all direct dependencies
136- # cf., https://github.com/astral-sh/uv#resolution-strategy
137- resolution : " lowest-direct"
138-
139- steps :
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
175- - name : Set up Python ${{ env.python-version }}
176- uses : actions/setup-python@v4
177- with :
178- python-version : ${{ env.python-version }}
179- - name : Install build dependencies
180- run : |
181- python -m pip install --upgrade pip
182- pip install uv
183-
184- uv venv
185- source .venv/bin/activate
31+ uses : geo-engine/geoengine-python/.github/workflows/test-python.yml@reusable-workflow
18632
187- uv pip install --resolution=${{ env.resolution }} -e .
188- uv pip install --resolution=${{ env.resolution }} -e .[dev]
189- - name : Build
190- run : |
191- source .venv/bin/activate
192- python -m build .
193- - name : Install test dependencies
194- run : |
195- source .venv/bin/activate
196- uv pip install --resolution=${{ env.resolution }} -e .[test]
197- - name : Test
198- run : |
199- source .venv/bin/activate
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"
33+ with :
34+ python-version : 3.9
35+ use-uv : true
36+ coverage : true
0 commit comments