[wip] Add support for Embree4 and WinArm GH runner. #354
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: Build | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CTEST_OUTPUT_ON_FAILURE: ON | |
| CTEST_PARALLEL_LEVEL: 1 | |
| jobs: | |
| #################### | |
| # Linux / macOS | |
| #################### | |
| Unix: | |
| name: ${{ matrix.os }} (${{ matrix.compiler }}, ${{ matrix.config }}, ${{ matrix.sanitizer }}Sanitizer) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-24.04, macos-15-intel, macos-15] | |
| config: [RelWithDebInfo, Debug] | |
| compiler: [gcc, apple, llvm] | |
| sanitizer: ["Address", "Thread"] # TODO: Add Memory+Undefined Sanitizer | |
| exclude: | |
| - os: macos-15-intel | |
| compiler: gcc | |
| - os: macos-15-intel | |
| sanitizer: Thread | |
| - os: macos-15-intel | |
| config: Debug | |
| - os: macos-15 | |
| compiler: gcc | |
| - os: ubuntu-24.04 | |
| compiler: apple | |
| steps: | |
| - name: Free Disk Space | |
| if: runner.os == 'Linux' | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| # this might remove tools that are actually needed, | |
| # if set to "true" but frees about 6 GB | |
| tool-cache: false | |
| # all of these default to true, but feel free to set to | |
| # "false" if necessary for your workflow | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: true | |
| docker-images: true | |
| swap-storage: true | |
| - name: Show disk space | |
| run: | | |
| echo "disk usage:" | |
| df -h | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 10 | |
| - name: Install Ninja | |
| uses: seanmiddleditch/gha-setup-ninja@master | |
| - name: Dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| if [ "${{ matrix.compiler }}" = "gcc" ]; then | |
| sudo apt-get install -y g++ | |
| echo "CC=gcc" >> $GITHUB_ENV | |
| echo "CXX=g++" >> $GITHUB_ENV | |
| else | |
| sudo apt-get install -y clang | |
| echo "CC=clang" >> $GITHUB_ENV | |
| echo "CXX=clang++" >> $GITHUB_ENV | |
| fi | |
| sudo apt-get install xorg-dev ccache | |
| - name: Dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install ccache | |
| if [ "${{ matrix.compiler }}" = "llvm" ]; then | |
| brew install llvm@17 | |
| echo "CC='$(brew --prefix llvm@17)/bin/clang'" >> $GITHUB_ENV | |
| echo "CXX='$(brew --prefix llvm@17)/bin/clang++'" >> $GITHUB_ENV | |
| fi | |
| - name: Setup Xcode version | |
| if: matrix.os == 'macos-15-intel' | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '16.4' | |
| - name: Setup Xcode version | |
| if: matrix.os == 'macos-15' | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '26.0.1' | |
| - name: Get number of CPU cores | |
| uses: SimenB/github-actions-cpu-cores@v1 | |
| id: cpu-cores | |
| - name: Cache Build | |
| id: cache-build | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.ccache | |
| key: ${{ matrix.name }}-${{ matrix.config }}-cache | |
| - name: Prepare ccache | |
| run: | | |
| ccache --max-size=1.0G | |
| ccache -V && ccache --show-stats && ccache --zero-stats | |
| - name: Configure | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake --version | |
| cmake .. -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.config }} \ | |
| -DLAGRANGE_JENKINS=ON \ | |
| -DLAGRANGE_ALL=ON \ | |
| -DLAGRANGE_LIMIT_PARALLELISM=ON \ | |
| -DOPENVDB_CORE_SHARED=ON \ | |
| -DOPENVDB_CORE_STATIC=OFF \ | |
| -DUSE_EXPLICIT_INSTANTIATION=OFF \ | |
| -DUSE_SANITIZER="${{ matrix.sanitizer }}" | |
| - name: Build | |
| run: | | |
| cmake --build build -j ${{ steps.cpu-cores.outputs.count }} | |
| ccache --show-stats | |
| - name: Show disk space | |
| if: always() | |
| run: | | |
| echo "disk usage:" | |
| df -h | |
| - name: Tests | |
| run: cd build; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} | |
| #################### | |
| # Windows | |
| #################### | |
| Windows: | |
| name: ${{ matrix.os }} (${{ matrix.config }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-2025, windows-11-arm] | |
| config: [Release, Debug] | |
| steps: | |
| - name: Show disk space | |
| run: Get-PSDrive | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 10 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.13 | |
| - name: Install Ninja | |
| uses: seanmiddleditch/gha-setup-ninja@master | |
| - name: Get number of CPU cores | |
| uses: SimenB/github-actions-cpu-cores@v1 | |
| id: cpu-cores | |
| - name: Configure sccache | |
| run: echo "SCCACHE_GHA_ENABLED=true" >> ${env:GITHUB_ENV} | |
| - name: Prepare sccache | |
| # Re-enable official action one https://github.com/Mozilla-Actions/sccache-action/pull/225 is merged | |
| # uses: mozilla-actions/sccache-action@v0.0.9 | |
| uses: Vee99BR/sccache-action@v0.0.1 | |
| - name: Set x64 vars | |
| if: matrix.os == 'windows-2025' | |
| run: | | |
| echo "BUILD_DIR=D:/build" >> ${env:GITHUB_ENV} | |
| echo "ARCH=x64" >> ${env:GITHUB_ENV} | |
| - name: Set arm64 vars | |
| if: matrix.os == 'windows-11-arm' | |
| run: | | |
| echo "BUILD_DIR=C:/build" >> ${env:GITHUB_ENV} | |
| echo "ARCH=arm64" >> ${env:GITHUB_ENV} | |
| - name: Setup MSVC Developer Command Prompt | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: ${{ env.ARCH }} | |
| # Cmd uses ^ to break commands into multiple lines, powershell uses ` | |
| - name: Configure | |
| run: | | |
| cmake --version | |
| cmake -G Ninja ` | |
| -DCMAKE_BUILD_TYPE=${{ matrix.config }} ` | |
| -DLAGRANGE_JENKINS=ON ` | |
| -DLAGRANGE_MODULE_RAYCASTING=ON ` | |
| -B ${{ env.BUILD_DIR }} ` | |
| -S . | |
| - name: Build | |
| run: | | |
| cmake --build ${{ env.BUILD_DIR }} -j ${{ steps.cpu-cores.outputs.count }} | |
| - name: Show disk space | |
| if: always() | |
| run: Get-PSDrive | |
| - name: Tests | |
| run: cd ${{ env.BUILD_DIR }}; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} |