From e9194ceb55b01d29c459f0b9508d04122f1d4ce0 Mon Sep 17 00:00:00 2001 From: d3v-null Date: Thu, 16 May 2024 15:22:32 +0800 Subject: [PATCH] fix macos CI use use brew boost (currently 1.85) and numpy use github gfortran-13 disable tLSQaips|tLSQFit for amd64 https://github.com/casacore/casacore/issues/1352 install to a writeable prefix --- .github/workflows/osx.yml | 61 +++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index 5e7177028b1..823ba3a3480 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -9,57 +9,68 @@ on: jobs: osx: - runs-on: macos-12 + runs-on: ${{matrix.os}} + strategy: + fail-fast: false + matrix: + os: + - macos-13 # x68 + - macos-14 # arm64 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: install homebrew deps - run: brew install fftw hdf5 boost-python3 cfitsio wcslib wget gfortran gsl ninja - - # See https://github.com/orgs/Homebrew/discussions/3895#discussioncomment-4130560 - - name: ensure we use homebrew python + - name: install dependencies, set python environment run: | - find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete - brew unlink python@3.11 - brew link python@3.11 + # Delete GitHub Python, See https://github.com/orgs/Homebrew/discussions/3895#discussioncomment-4130560 + find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -print -delete - - name: pip install numpy - run: pip3 install numpy + brew install fftw hdf5 boost-python3 numpy cfitsio wcslib gsl ninja - - name: get WSRT measures - run: wget ftp://ftp.astron.nl/outgoing/Measures/WSRT_Measures.ztar -O WSRT_Measures.ztar + # ensure we use homebrew python (needed for macos-13-x86, not macos-14-arm64) + export PATH=$(brew --prefix python)/bin:${PATH} + echo PATH=$PATH | tee -a $GITHUB_ENV - - name: make build folder + - name: set up build folder with WSRT measures run: | + wget ftp://ftp.astron.nl/outgoing/Measures/WSRT_Measures.ztar -O WSRT_Measures.ztar mkdir -p build cd build tar zxvf ../WSRT_Measures.ztar + rm ../WSRT_Measures.ztar - name: configure run: | cd build cmake \ -G Ninja \ - -DBUILD_TESTING=ON \ + -DCMAKE_Fortran_COMPILER=$(which gfortran-13) \ -DCMAKE_PREFIX_PATH=/usr/local/ \ - -DUSE_OPENMP=OFF \ - -DUSE_HDF5=ON \ + -DBoost_NO_BOOST_CMAKE=True \ + -DBUILD_TESTING=ON \ -DBUILD_PYTHON=OFF \ -DBUILD_PYTHON3=ON \ - -DPython3_EXECUTABLE=`which python3.11` \ - -DBoost_NO_BOOST_CMAKE=True \ - -DCMAKE_Fortran_COMPILER=gfortran-13 \ - -DDATA_DIR=. .. + -DPython3_EXECUTABLE=$(which python3) \ + -DUSE_HDF5=ON \ + -DUSE_OPENMP=OFF \ + -DDATA_DIR=. \ + .. - - name: build + - name: make run: cmake --build build - name: run tests run: | cd build - CTEST_OUTPUT_ON_FAILURE=1 ctest -E tConvert + export ctest_args="" + # disable tests on amd64 https://github.com/casacore/casacore/issues/1352 + if [[ "$(uname -m)" == "arm64" ]]; then + export ctest_args="-E tLSQaips|tLSQFit" + fi + CTEST_OUTPUT_ON_FAILURE=1 ctest $ctest_args - name: install - run: cmake --build build --target install + run: | + mkdir install + cmake --build build --target install --prefix install