forked from apache/sedona-db
-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (125 loc) · 4.11 KB
/
python.yml
File metadata and controls
147 lines (125 loc) · 4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: python
on:
pull_request:
branches:
- main
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/python.yml'
- 'rust/**'
- 'c/**'
- 'python/**'
push:
branches:
- main
concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}-rust
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
shell: bash -l -eo pipefail {0}
env:
# At GEOS updated to 3.14.0
VCPKG_REF: 5a01de756c28279ddfdd2b061d1c75710a6255fa
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
name: "python ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
env:
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/setup-python@v4
with:
python-version: '3.13'
cache: 'pip'
- name: Clone vcpkg
uses: actions/checkout@v4
with:
repository: microsoft/vcpkg
ref: ${{ env.VCPKG_REF }}
path: vcpkg
- name: Set up environment variables and bootstrap vcpkg
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
run: |
cd vcpkg
./bootstrap-vcpkg.sh
cd ..
echo "VCPKG_ROOT=$VCPKG_ROOT" >> $GITHUB_ENV
echo "PATH=$VCPKG_ROOT:$PATH" >> $GITHUB_ENV
echo "CMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE" >> $GITHUB_ENV
- name: Cache vcpkg binaries
id: cache-vcpkg
uses: actions/cache@v4
with:
path: vcpkg/packages
# Bump the number at the end of this line to force a new dependency build
key: vcpkg-installed-${{ runner.os }}-${{ runner.arch }}-${{ env.VCPKG_REF }}-2
- name: Install vcpkg dependencies
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
run: |
./vcpkg/vcpkg install abseil openssl
- name: Use stable Rust
id: rust
run: |
rustup toolchain install stable --no-self-update
rustup default stable
- name: Install dependencies
shell: bash
run: sudo apt-get update && sudo apt-get install -y libgeos-dev
- uses: Swatinem/rust-cache@v2
with:
# Update this key to force a new cache (sync with packaging.yml)
prefix-key: "python-v2"
- name: Install
run: |
# Keep this export in sync with the export in dev/release/verify-release-candidate.sh
export MATURIN_PEP517_ARGS="--features s2geography"
pip install -e "python/sedonadb/[test]" -vv
- name: Download minimal geoarrow-data assets
run: |
python submodules/download-assets.py "*water-junc*" "*water-point*"
- name: Start PostGIS
run: |
docker compose up --wait --detach postgis
- name: Run tests
env:
# Ensure that we don't skip tests that we didn't intend to
SEDONADB_PYTHON_NO_SKIP_TESTS: "true"
run: |
cd python
python -m pytest -vv
- name: Run doctests
run: |
cd python
python -m pytest --doctest-modules
- name: Shutdown docker compose services
if: always()
run: |
docker compose down