From 641c837645794cbe27c7a4d218ae38b2c4ed7431 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 17 Mar 2024 02:01:16 +0100 Subject: [PATCH] CI: port macos.yml to macos-14 Arm64, and re-enable Python tests --- .github/workflows/macos.yml | 4 ++-- ci/travis/osx/before_install.sh | 4 ++-- ci/travis/osx/install.sh | 23 ++++++++++------------- ci/travis/osx/script.sh | 12 +++--------- 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4ab2d0be775b..1d13cd00f437 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -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: diff --git a/ci/travis/osx/before_install.sh b/ci/travis/osx/before_install.sh index 3f5cc827f46e..e409e7799313 100755 --- a/ci/travis/osx/before_install.sh +++ b/ci/travis/osx/before_install.sh @@ -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 diff --git a/ci/travis/osx/install.sh b/ci/travis/osx/install.sh index 3fe4a94ceb81..00e392ae0633 100755 --- a/ci/travis/osx/install.sh +++ b/ci/travis/osx/install.sh @@ -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 @@ -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 .. diff --git a/ci/travis/osx/script.sh b/ci/travis/osx/script.sh index 81bda34bd284..4bf71823f6b7 100755 --- a/ci/travis/osx/script.sh +++ b/ci/travis/osx/script.sh @@ -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})