CI: fix macOS runners + build a single py3-none wheel (Python 3.14) (… #273
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/gridtools/gridtools-base:${{ matrix.compiler }} | |
| strategy: | |
| matrix: | |
| compiler: [gcc-10, gcc-13, gcc-14, clang-17, clang-18, clang-19] | |
| build_type: [Debug, Release] | |
| exclude: | |
| - compiler: gcc-10 | |
| build_type: Debug | |
| - compiler: gcc-13 | |
| build_type: Debug | |
| - compiler: clang-17 | |
| build_type: Debug | |
| - compiler: clang-18 | |
| build_type: Debug | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - name: Enable Fortran | |
| if: startsWith(matrix.compiler, 'gcc') | |
| run: echo "TEST_FORTRAN=ON" >> $GITHUB_ENV | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install python modules | |
| run: python3 -m pip install nose-py3 numpy packaging | |
| - name: Cache pFUnit | |
| id: cache-pfunit | |
| uses: actions/cache@v4 | |
| with: | |
| path: pfunit | |
| key: ${{ matrix.compiler }}-pfunit | |
| - name: Install pFUnit | |
| if: startsWith(matrix.compiler, 'gcc') && steps.cache-pfunit.outputs.cache-hit != 'true' | |
| env: | |
| PFUNIT_VERSION: 4.6.3 | |
| run: | | |
| apt-get update && apt-get -y install m4 | |
| git clone --branch v${PFUNIT_VERSION} --depth 1 https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git | |
| cd pFUnit | |
| mkdir -p build && cd build | |
| cmake .. -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/pfunit | |
| make -j8 install | |
| - name: Prepare ccache timestamp | |
| id: ccache_cache_timestamp | |
| shell: cmake -P {0} | |
| run: | | |
| string(TIMESTAMP current_date "%Y-%m-%d-%H-%M-%S" UTC) | |
| message("echo \"timestamp=${current_date}\" >> $GITHUB_OUTPUT") | |
| - name: Set ccache environment | |
| run: | | |
| echo "CCACHE_MAXSIZE=400M" >> $GITHUB_ENV | |
| echo "CCACHE_BASEDIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV | |
| echo "CCACHE_DIR=$GITHUB_WORKSPACE/.ccache" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESS=true" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESSLEVEL=6" >> $GITHUB_ENV | |
| - name: ccache cache files | |
| uses: actions/cache@v4 | |
| with: | |
| path: .ccache | |
| key: ${{ matrix.compiler }}-${{ matrix.build_type }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} | |
| restore-keys: | | |
| ${{ matrix.compiler }}-${{ matrix.build_type }}-ccache- | |
| - name: Configure | |
| run: | | |
| ccache -s | |
| mkdir build && cd build | |
| cmake .. \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
| -DPython3_EXECUTABLE=`which python3` \ | |
| -DSERIALBOX_TESTING=ON \ | |
| -DSERIALBOX_ENABLE_FORTRAN=${TEST_FORTRAN} \ | |
| -DSERIALBOX_TESTING_FORTRAN=${TEST_FORTRAN} \ | |
| -DSERIALBOX_TESTING_PYTHON=ON \ | |
| -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/pfunit \ | |
| -DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
| - name: Build | |
| run: cmake --build build --parallel 2 | |
| - name: Execute tests | |
| run: cd build && ctest --output-on-failure |