Fix Windows debug build failures (#1562) #10850
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 Windows | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - "**/website/**" | |
| pull_request: | |
| branches: | |
| - "**" | |
| paths-ignore: | |
| - "**/website/**" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| momentum: | |
| # Disabled: Too slow for CI (use sccache on local development) | |
| if: false | |
| name: cpp-${{ matrix.mode == '' && 'opt' || 'dev' }}-win | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| mode: [""] # TODO: Add -dev model | |
| env: | |
| # Enable sccache for C++ compilation caching | |
| CMAKE_GENERATOR: Ninja | |
| CMAKE_GENERATOR_INSTANCE: "" | |
| CMAKE_GENERATOR_PLATFORM: "" | |
| CMAKE_GENERATOR_TOOLSET: "" | |
| CMAKE_C_COMPILER_LAUNCHER: sccache | |
| CMAKE_CXX_COMPILER_LAUNCHER: sccache | |
| SCCACHE_CACHE_SIZE: "2G" | |
| SCCACHE_DIR: ${{ github.workspace }}/.sccache | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Restore sccache | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: .sccache | |
| key: ${{ github.workflow }}-win-sccache-cpp-${{ matrix.mode == '' && 'opt' || 'dev' }}-${{ hashFiles('pixi.lock', 'CMakeLists.txt', 'cmake/**', 'momentum/**', 'pymomentum/**', 'axel/**') }} | |
| restore-keys: | | |
| ${{ github.workflow }}-win-sccache-cpp-${{ matrix.mode == '' && 'opt' || 'dev' }}- | |
| ${{ github.workflow }}-win-sccache- | |
| - name: Set up sccache | |
| uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 | |
| - name: Set up pixi | |
| uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.9.5 | |
| with: | |
| cache: true | |
| cache-write: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| - name: Build and test Momentum | |
| run: | | |
| pixi run test${{ matrix.mode }} | |
| - name: Install Momentum and Build hello_world | |
| run: | | |
| pixi run install_no_build | |
| pixi run cmake ` | |
| -S momentum/examples/hello_world ` | |
| -B momentum/examples/hello_world/build | |
| pixi run cmake ` | |
| --build momentum/examples/hello_world/build ` | |
| --config Release ` | |
| --parallel | |
| - name: Print sccache stats | |
| run: sccache --show-stats | |
| pymomentum: | |
| # Enabled: CPU-only for cost optimization (GPU disabled) | |
| name: py-${{ matrix.pixi_env }}-win | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - pixi_env: "py312" | |
| # GPU disabled to reduce CI cost | |
| # - pixi_env: "py312-cuda129" | |
| # cuda_version: "12.9.0" | |
| env: | |
| FULL_CUDA_VERSION: ${{ matrix.cuda_version }} | |
| # Enable sccache for C++ compilation caching | |
| CMAKE_GENERATOR: Ninja | |
| CMAKE_GENERATOR_INSTANCE: "" | |
| CMAKE_GENERATOR_PLATFORM: "" | |
| CMAKE_GENERATOR_TOOLSET: "" | |
| CMAKE_C_COMPILER_LAUNCHER: sccache | |
| CMAKE_CXX_COMPILER_LAUNCHER: sccache | |
| SCCACHE_CACHE_SIZE: "2G" | |
| SCCACHE_DIR: ${{ github.workspace }}/.sccache | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Restore sccache | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: .sccache | |
| key: ${{ github.workflow }}-win-sccache-py-${{ matrix.pixi_env }}-${{ hashFiles('pixi.lock', 'CMakeLists.txt', 'cmake/**', 'momentum/**', 'pymomentum/**', 'axel/**') }} | |
| restore-keys: | | |
| ${{ github.workflow }}-win-sccache-py-${{ matrix.pixi_env }}- | |
| ${{ github.workflow }}-win-sccache- | |
| - name: Set up sccache | |
| uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 | |
| - name: Setup CUDA | |
| if: ${{ contains(matrix.pixi_env, 'cuda') || contains(matrix.pixi_env, 'gpu') }} | |
| uses: ./.github/actions/setup-cuda | |
| with: | |
| cuda-version: ${{ matrix.cuda_version }} | |
| - name: Set up pixi | |
| uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.9.5 | |
| with: | |
| cache: true | |
| cache-write: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| - name: Build and test PyMomentum | |
| run: | | |
| pixi run -e ${{ matrix.pixi_env }} test_py | |
| - name: Print sccache stats | |
| run: sccache --show-stats |