-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend testing workflow to test on mac (intel and arm) (#42)
* Add testing on MacOS (intel and m1) * Add filters to avoid running tests when only docs are updated * Skip python 3.8 and 3.9 for arm macos due to issue with runners. Update brew reinstall to avoid brew issue in intel macos * Update defined symbol search to take into account that symbols in macOS have and underscore prepended * Set DYLD_LIBRARY_PATH * Add rounding in srid transformation tests to account for floating point precision differences * Move is_ever_disjoint to TGeomPoint for comparisons with base geometries. Remove corresponding tests of TGeogPoint
- Loading branch information
Showing
9 changed files
with
1,121 additions
and
960 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,56 +3,102 @@ name: Test PyMEOS | |
on: | ||
push: | ||
branches: [ "develop", "master" ] | ||
paths-ignore: | ||
- "docs/**" | ||
- ".readthedocs.yml" | ||
- "README.md" | ||
pull_request: | ||
branches: [ "develop", "master" ] | ||
paths-ignore: | ||
- "docs/**" | ||
- ".readthedocs.yml" | ||
- "README.md" | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-22.04 | ||
test: | ||
name: Test PyMEOS - Python ${{ matrix.python-version }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] | ||
os: [ ubuntu-latest, macos-13, macos-14 ] | ||
exclude: | ||
# Necessary due to issue with macOS runners. See | ||
# https://github.com/actions/setup-python/issues/808 | ||
# Can be removed once this PR is merged: | ||
# https://github.com/actions/python-versions/pull/259 | ||
- os: macos-14 | ||
python-version: "3.8" | ||
- os: macos-14 | ||
python-version: "3.9" | ||
include: | ||
- ld_path: "/usr/local/lib" | ||
- os: macos-14 | ||
ld_path: "/opt/homebrew/lib" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: awalsh128/cache-apt-pkgs-action@latest | ||
- name: Get dependencies from apt (cache) | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
if: runner.os == 'Linux' | ||
with: | ||
packages: build-essential cmake postgresql-server-dev-14 libproj-dev libjson-c-dev libgsl-dev libgeos-dev | ||
version: 1.0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
- name: Update brew | ||
if: matrix.os == 'macos-13' | ||
# Necessary to avoid issue with macOS runners. See | ||
# https://github.com/actions/runner-images/issues/4020 | ||
run: | | ||
brew reinstall [email protected] || brew link --overwrite [email protected] | ||
brew reinstall [email protected] || brew link --overwrite [email protected] | ||
brew update | ||
- name: Get dependencies from homebrew (cache) | ||
uses: tecolicom/actions-use-homebrew-tools@v1 | ||
if: runner.os == 'macOS' | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
tools: cmake libpq proj json-c gsl geos | ||
|
||
- name: Install MEOS | ||
- name: Fetch MEOS sources | ||
env: | ||
BRANCH_NAME: ${{ github.base_ref || github.ref_name }} | ||
run: | | ||
git clone --branch ${{ env.BRANCH_NAME }} --depth 1 https://github.com/MobilityDB/MobilityDB | ||
- name: Install MEOS | ||
run: | | ||
mkdir MobilityDB/build | ||
cd MobilityDB/build | ||
cmake .. -DMEOS=on | ||
make -j | ||
sudo make install | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
|
||
- name: Install python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r pymeos_cffi/dev-requirements.txt | ||
pip install -r pymeos/dev-requirements.txt | ||
- name: Install pymeos_cffi | ||
run: | | ||
cd pymeos_cffi | ||
python ./pymeos_cffi/builder/build_header.py | ||
python ./pymeos_cffi/builder/build_pymeos_functions.py | ||
pip install . | ||
cd .. | ||
- name: Test PyMEOS with pytest | ||
run: | | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ matrix.ld_path }} | ||
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${{ matrix.ld_path }} | ||
cd pymeos | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.