|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.ref }}-${{ github.workflow }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +env: |
| 13 | + HOMEBREW_NO_INSTALL_CLEANUP: 1 |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + name: ${{ matrix.name }} |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + env: |
| 20 | + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.osx_target }} |
| 21 | + strategy: |
| 22 | + fail-fast: false |
| 23 | + matrix: |
| 24 | + include: |
| 25 | + - name: Linux |
| 26 | + os: ubuntu-24.04 |
| 27 | + osx_target: "" |
| 28 | + cmake_flags: "" |
| 29 | + cxx_flags: "-march=x86-64-v2" |
| 30 | + |
| 31 | + - name: macOS-X64 |
| 32 | + os: macos-13 |
| 33 | + osx_target: "10.15" |
| 34 | + cmake_flags: "-D CMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang -D CMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++" |
| 35 | + cxx_flags: "-march=x86-64-v2" |
| 36 | + |
| 37 | + - name: macOS-ARM64 |
| 38 | + os: macos-14 |
| 39 | + osx_target: "11.0" |
| 40 | + cmake_flags: "-D CMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang -D CMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++" |
| 41 | + cxx_flags: "" |
| 42 | + |
| 43 | + - name: Windows |
| 44 | + os: windows-latest |
| 45 | + osx_target: "" |
| 46 | + cmake_flags: "" |
| 47 | + cxx_flags: "-march=x86-64-v2" |
| 48 | + |
| 49 | + steps: |
| 50 | + - name: Checkout code |
| 51 | + uses: actions/checkout@v4 |
| 52 | + with: |
| 53 | + lfs: true |
| 54 | + |
| 55 | + - name: Install dependencies (Linux) |
| 56 | + if: runner.os == 'Linux' |
| 57 | + run: | |
| 58 | + sudo apt update -y |
| 59 | + sudo apt install -y libomp-dev ninja-build |
| 60 | +
|
| 61 | + - name: Install dependencies (macOS) |
| 62 | + if: runner.os == 'macOS' |
| 63 | + run: brew install ninja llvm |
| 64 | + |
| 65 | + - name: Install dependencies (Windows) |
| 66 | + if: runner.os == 'Windows' |
| 67 | + shell: bash |
| 68 | + run: choco install ninja |
| 69 | + |
| 70 | + - name: Install clang |
| 71 | + if: runner.os == 'Windows' |
| 72 | + uses: egor-tensin/setup-clang@v1 |
| 73 | + |
| 74 | + - name: CMake configure |
| 75 | + run: cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=Release -D CMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" ${{ matrix.cmake_flags }} |
| 76 | + |
| 77 | + - name: CMake build |
| 78 | + run: cmake --build build |
| 79 | + |
| 80 | + # - name: CTest |
| 81 | + # run: ctest --test-dir build -C Release --output-on-failure -j 1 |
0 commit comments