|
| 1 | +# ref: https://github.com/actions/runner-images |
| 2 | +name: arm64 MacOS CMake Python |
| 3 | + |
| 4 | +on: [push, pull_request, workflow_dispatch] |
| 5 | + |
| 6 | +# Building using the github runner environement directly. |
| 7 | +jobs: |
| 8 | + native: |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + cmake: [ |
| 12 | + {generator: "Xcode", config: Release, build_target: ALL_BUILD, test_target: RUN_TESTS, install_target: install}, |
| 13 | + {generator: "Unix Makefiles", config: Release, build_target: all, test_target: test, install_target: install}, |
| 14 | + ] |
| 15 | + python: [ |
| 16 | + {version: "3.9"}, |
| 17 | + {version: "3.10"}, |
| 18 | + {version: "3.11"}, |
| 19 | + {version: "3.12"} |
| 20 | + ] |
| 21 | + fail-fast: false |
| 22 | + name: MacOS • ${{ matrix.cmake.generator }} • Python-${{ matrix.python.version }} |
| 23 | + runs-on: macos-latest # macos arm64 based runner |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + - name: Swig install |
| 27 | + run: | |
| 28 | + brew install swig |
| 29 | + swig -version |
| 30 | + - name: Setup Python |
| 31 | + uses: actions/setup-python@v4 |
| 32 | + with: |
| 33 | + python-version: ${{ matrix.python.version }} |
| 34 | + - name: Update Path |
| 35 | + run: | |
| 36 | + echo "$HOME/Library/Python/${{ matrix.python.version }}/bin" >> $GITHUB_PATH |
| 37 | + echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 38 | + - name: Check cmake |
| 39 | + run: cmake --version |
| 40 | + - name: Configure |
| 41 | + run: > |
| 42 | + cmake -S. -Bbuild |
| 43 | + -G "${{ matrix.cmake.generator }}" |
| 44 | + -DCMAKE_BUILD_TYPE=${{ matrix.cmake.config }} |
| 45 | + -DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF |
| 46 | + -DBUILD_PYTHON=ON |
| 47 | + -DCMAKE_INSTALL_PREFIX=install |
| 48 | + - name: Build |
| 49 | + run: > |
| 50 | + cmake --build build |
| 51 | + --config ${{ matrix.cmake.config }} |
| 52 | + --target ${{ matrix.cmake.build_target }} |
| 53 | + -v -j2 |
| 54 | + - name: Test |
| 55 | + run: > |
| 56 | + CTEST_OUTPUT_ON_FAILURE=1 |
| 57 | + cmake --build build |
| 58 | + --config ${{ matrix.cmake.config }} |
| 59 | + --target ${{ matrix.cmake.test_target }} |
| 60 | + -v |
| 61 | + - name: Install |
| 62 | + run: > |
| 63 | + cmake --build build |
| 64 | + --config ${{ matrix.cmake.config }} |
| 65 | + --target ${{ matrix.cmake.install_target }} |
| 66 | + -v |
0 commit comments