1919
2020jobs :
2121 test :
22- name : " python with GPU ${{ matrix.os }}"
22+ strategy :
23+ fail-fast : false
24+ matrix :
25+ include :
26+ - variant : libgpuspatial
27+ run_libgpuspatial : true
28+ run_python_gpu : false
29+ - variant : python_gpu
30+ run_libgpuspatial : false
31+ run_python_gpu : true
32+ name : " GPU workflow (${{ matrix.variant }})"
2333 runs-on : depot-ubuntu-22.04-16-gpu
2434 env :
2535 CARGO_INCREMENTAL : 0
7585
7686 - name : Use stable Rust
7787 id : rust
88+ if : matrix.run_python_gpu
7889 run : |
7990 rustup toolchain install stable --no-self-update
8091 rustup default stable
@@ -95,19 +106,29 @@ jobs:
95106 #sudo update-alternatives --set cuda /usr/local/cuda-12.4
96107
97108 - uses : Swatinem/rust-cache@v2
109+ if : matrix.run_python_gpu
98110 with :
99111 # Update this key to force a new cache (sync with packaging.yml)
100112 prefix-key : " python-v3"
101113
114+ - name : Cache libgpuspatial manifest installs
115+ if : matrix.run_libgpuspatial
116+ uses : actions/cache@v5
117+ with :
118+ path : c/sedona-libgpuspatial/libgpuspatial/build/vcpkg_installed
119+ key : libgpuspatial-vcpkg-installed-${{ runner.os }}-${{ runner.arch }}-${{ env.VCPKG_REF }}-${{ hashFiles('c/sedona-libgpuspatial/libgpuspatial/vcpkg.json', 'c/sedona-libgpuspatial/libgpuspatial/CMakeLists.txt', 'c/sedona-libgpuspatial/libgpuspatial/CMakePresets.json') }}
120+
102121 - name : Build libgpuspatial Tests
122+ if : matrix.run_libgpuspatial
103123 run : |
104124 echo "=== Building libgpuspatial tests ==="
105125 cd c/sedona-libgpuspatial/libgpuspatial
106- mkdir build
107- cmake --preset=default-with-tests -S . -B build
126+ mkdir -p build
127+ cmake --preset=default-with-tests -S . -B build -DCMAKE_CUDA_ARCHITECTURES=86
108128 cmake --build build --target all
109129
110130 - name : Run libgpuspatial tests
131+ if : matrix.run_libgpuspatial
111132 run : |
112133 echo "=== Running libgpuspatial tests ==="
113134 cd c/sedona-libgpuspatial/libgpuspatial/build
@@ -120,23 +141,28 @@ jobs:
120141 done
121142
122143 - name : Install
144+ if : matrix.run_python_gpu
123145 run : |
124146 # Keep this export in sync with the export in dev/release/verify-release-candidate.sh
125147 export MATURIN_PEP517_ARGS="--features s2geography,gpu"
126148 pip install -e "python/sedonadb/[test]" -vv
127149
128150 - name : Download minimal geoarrow-data assets
151+ if : matrix.run_python_gpu
129152 run : |
130153 python submodules/download-assets.py "*water-junc*" "*water-point*"
131154
132155 - name : Start PostGIS
156+ if : matrix.run_python_gpu
133157 run : |
134158 docker compose up --wait --detach postgis
135159
136160 - name : Print GPU status
161+ if : matrix.run_python_gpu
137162 run : nvidia-smi
138163
139164 - name : Run tests
165+ if : matrix.run_python_gpu
140166 env :
141167 # Ensure that we don't skip tests that we didn't intend to
142168 SEDONADB_PYTHON_NO_SKIP_TESTS : " true"
@@ -145,6 +171,6 @@ jobs:
145171 python -m pytest -vv sedonadb/tests/test_sjoin_gpu.py
146172
147173 - name : Shutdown docker compose services
148- if : always()
174+ if : ${{ always() && matrix.run_python_gpu }}
149175 run : |
150176 docker compose down
0 commit comments