Skip to content

Commit

Permalink
CI: port macos.yml to macos-14 Arm64, and re-enable Python tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Mar 17, 2024
1 parent eab6b4a commit 015b332
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ permissions:
jobs:

macos_build:
# FIXME: Python tests fail with "ModuleNotFoundError: No module named '_gdal'" with macos-12
runs-on: macos-11
# Arm64
runs-on: macos-14
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:

Expand Down
4 changes: 2 additions & 2 deletions ci/travis/osx/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ conda update -n base -c defaults conda
conda install -y compilers automake pkgconfig cmake

conda config --set channel_priority strict
conda install --yes --quiet proj python=3.8 swig lxml jsonschema numpy -y
conda install --yes --quiet libgdal=3.7.0=hc13fe4b_4 --only-deps -y
conda install --yes --quiet proj python=3.12 swig lxml jsonschema numpy -y
conda install --yes --quiet libgdal libgdal-arrow-parquet --only-deps -y
23 changes: 10 additions & 13 deletions ci/travis/osx/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

CONDA_PREFIX=/usr/local/miniconda/envs/test
CONDA_PREFIX=/Users/runner/miniconda3/envs/test

# Few tricks from https://github.com/conda-forge/gdal-feedstock/blob/master/recipe/build.sh

Expand All @@ -16,27 +16,24 @@ cd build
# to have an environment where we test this...
export GDAL_PYTHON_BINDINGS_WITHOUT_NUMPY=YES

# Disable Arrow/Parquet because the VM provides libraries in /usr/local/lib/
# that cause Illegal instruction error when running tests. I suspect the
# Arrow/Parquet libraries to be built with AVX2 support but the VM worker
# doesn't support it.
CFLAGS="-Wextra -Werror" CXXFLAGS="-Wextra -Werror" cmake .. \
-DCMAKE_INSTALL_PREFIX=$HOME/install-gdal \
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \
-DCMAKE_PREFIX_PATH=${CONDA_PREFIX} \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DGDAL_USE_GEOTIFF_INTERNAL=ON \
-DGDAL_USE_PNG_INTERNAL=ON \
-DGDAL_USE_POSTGRESQL=OFF \
-DGDAL_USE_WEBP=OFF \
-DGDAL_USE_ARROW=OFF \
-DGDAL_USE_PARQUET=OFF \
-DBUILD_CSHARP_BINDINGS=OFF \
-DCMAKE_UNITY_BUILD=ON
make -j3

NPROC=$(sysctl -n hw.ncpu)
echo "NPROC=${NPROC}"
make -j${NPROC}

echo "Show which shared libs got used:"
otool -L apps/ogrinfo

make install
cd ..

# Post-install testing
# ../autotest/postinstall/test_pkg-config.sh $HOME/install-gdal
cd ..
12 changes: 3 additions & 9 deletions ci/travis/osx/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@ echo 'Running Python unit tests'
# install test dependencies
sudo -H pip3 install -r autotest/requirements.txt

# https://github.com/rouault/gdal/runs/1300694473
# import issues of ogr_pg from ../ogr
mv autotest/utilities/test_ogr2ogr.py autotest/utilities/test_ogr2ogr.py.disabled
mv autotest/pyscripts/test_ogr2ogr_py.py autotest/pyscripts/test_ogr2ogr_py.py.disabled
NPROC=$(sysctl -n hw.ncpu)
echo "NPROC=${NPROC}"

# Run all the Python autotests
(cd build && ctest -V -R autotest)

# For some reason, the tests crash at process exit
# (cd autotest; $PYTEST 2>&1 | tee /tmp/log.txt || /bin/true)
# tail /tmp/log.txt | grep "Failed: 0 (0 blew exceptions)" >/dev/null
(cd build && ctest -V -R autotest -j${NPROC})

0 comments on commit 015b332

Please sign in to comment.