|
| 1 | +name: Build and test macOS 15 |
| 2 | +# Builds FANS for macOS 15 on Apple Silicon CPU and runs the tests. |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + - develop |
| 9 | + pull_request: |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} |
| 14 | + cancel-in-progress: ${{github.event_name == 'pull_request'}} |
| 15 | + |
| 16 | +jobs: |
| 17 | + build-macos: |
| 18 | + name: macOS 15 |
| 19 | + runs-on: macos-15 |
| 20 | + env: |
| 21 | + FANS_BUILD_DIR: build |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + steps: |
| 25 | + - name: Checkout code |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Install FANS dependencies |
| 29 | + run: | |
| 30 | + brew install gnu-time cmake gcc@14 |
| 31 | + brew install open-mpi --build-from-source --cc=gcc-14 |
| 32 | + brew install fftw hdf5-mpi eigen |
| 33 | +
|
| 34 | + - name: Generate build directory |
| 35 | + run: mkdir -p ${{ env.FANS_BUILD_DIR }} |
| 36 | + |
| 37 | + - name: Configure |
| 38 | + working-directory: ${{ env.FANS_BUILD_DIR }} |
| 39 | + env: |
| 40 | + CC: gcc-14 |
| 41 | + CXX: g++-14 |
| 42 | + MPICC: mpicc |
| 43 | + MPICXX: mpicxx |
| 44 | + run: | |
| 45 | + cmake --version |
| 46 | + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. |
| 47 | +
|
| 48 | + - uses: actions/upload-artifact@v4 |
| 49 | + if: failure() |
| 50 | + with: |
| 51 | + name: macOS 15 CMakeCache |
| 52 | + path: ${{ env.FANS_BUILD_DIR }}/CMakeCache.txt |
| 53 | + - uses: actions/upload-artifact@v4 |
| 54 | + if: failure() |
| 55 | + with: |
| 56 | + name: macOS 15 CMakeLogs |
| 57 | + path: '${{ env.FANS_BUILD_DIR }}/CMakeFiles/*.log' |
| 58 | + - uses: actions/upload-artifact@v4 |
| 59 | + if: failure() |
| 60 | + with: |
| 61 | + name: macOS 15 CompileCommands |
| 62 | + path: ${{ env.FANS_BUILD_DIR }}/compile_commands.json |
| 63 | + |
| 64 | + - name: Compile |
| 65 | + working-directory: ${{ env.FANS_BUILD_DIR }} |
| 66 | + run: |
| 67 | + cmake --build . -j $(nproc) || cmake --build . -j1 |
| 68 | + |
| 69 | + - name: Tests |
| 70 | + working-directory: ${{ env.FANS_BUILD_DIR }} |
| 71 | + env: |
| 72 | + CTEST_OUTPUT_ON_FAILURE: 1 |
| 73 | + run: ctest |
| 74 | + |
| 75 | + - uses: actions/upload-artifact@v4 |
| 76 | + if: failure() |
| 77 | + with: |
| 78 | + name: macOS 15 CTest logs |
| 79 | + path: ${{ env.FANS_BUILD_DIR }}/Testing/Temporary/LastTest.log |
0 commit comments