Skip to content

Add binding to calculate distance between two geometries #231

Add binding to calculate distance between two geometries

Add binding to calculate distance between two geometries #231

Workflow file for this run

on:
push:
branches: [main]
pull_request:
branches: [main]
name: Run tests
jobs:
test:
name: ${{ matrix.os }}, ${{ matrix.python-version }}, ${{ matrix.env }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.10", "3.11", "3.12"]
dev: [false]
env:
- ci/environment.yml
include:
- env: ci/environment-dev.yml
os: ubuntu-latest
python-version: "3.12"
dev: true
- env: ci/environment-dev.yml
os: macos-latest
python-version: "3.12"
dev: true
- env: ci/environment-dev.yml
os: windows-latest
python-version: "3.12"
dev: true
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Get Date
id: get-date
# cache will last one day
run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')"
- name: Setup micromamba
uses: mamba-org/provision-with-micromamba@v15
with:
environment-file: ${{ matrix.env }}
environment-name: spherely-dev
cache-env: true
cache-env-key: "${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ steps.get-date.outputs.today }}-${{ hashFiles( matrix.env) }}"
extra-specs: |
python=${{ matrix.python-version }}
- name: Fetch s2geography
uses: actions/checkout@v3
with:
repository: paleolimbot/s2geography
ref: master
path: deps/s2geography
fetch-depth: 0
if: |
matrix.dev == true
- name: Configure, build & install s2geography (unix)
run: |
cd deps/s2geography
cmake -S . -B build \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_BUILD_TYPE=Release \
-DS2GEOGRAPHY_S2_SOURCE=CONDA \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
cmake --build build
cmake --install build
if: |
matrix.dev == true &&
(runner.os == 'Linux' || runner.os == 'macOS')
- name: Configure, build & install s2geography (win)
run: |
cd deps/s2geography
cmake -S . -B build \
-DCMAKE_CXX_STANDARD=17 \
-DS2GEOGRAPHY_S2_SOURCE=CONDA \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX/Library \
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE
cmake --build build --config Release
cmake --install build
if: |
matrix.dev == true && runner.os == 'Windows'
- name: Build and install spherely
run: |
python -m pip install . -v --no-build-isolation --config-settings cmake.define.SPHERELY_CODE_COVERAGE=ON --config-settings build-dir=_skbuild
- name: Run tests
run: |
pytest . -vv
- name: Generate and upload coverage report
uses: codecov/codecov-action@v3
with:
gcov: true
gcov_include: src
verbose: true
if: |
runner.os == 'Linux' && matrix.python-version == '3.11' && matrix.dev == false