Fix finite negative GeneralizedLoss alpha handling (#1559) #10861
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 Ubuntu | |
| 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: | |
| name: cpp${{ matrix.simd == 'ON' && '-simd' || '' }}-${{ matrix.mode == '' && 'opt' || 'dev' }}-ubuntu | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| simd: ["ON"] # Only test SIMD=ON (production config) to reduce CI cost | |
| mode: [""] | |
| env: | |
| MOMENTUM_ENABLE_SIMD: ${{ matrix.simd }} | |
| CMAKE_C_COMPILER_LAUNCHER: ccache | |
| CMAKE_CXX_COMPILER_LAUNCHER: ccache | |
| CCACHE_EXTRAFILES: /tmp/native-cpu.txt | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Record native CPU for ccache | |
| run: | | |
| lscpu | sed -n '/^Model name:/p;/^Flags:/p' > /tmp/native-cpu.txt | |
| - name: Set up ccache | |
| uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 | |
| with: | |
| key: ${{ github.workflow }}-cpp-ubuntu-simd-${{ matrix.simd }}-${{ matrix.mode == '' && 'opt' || 'dev' }} | |
| # ccache-action appends a timestamp when saving; restore keys are the timestamp-free prefixes. | |
| # Keep SIMD and build mode in the cache key. Native CPU information | |
| # belongs in CCACHE_EXTRAFILES so one archive can contain entries for | |
| # multiple GitHub runner CPU variants while ccache still rejects | |
| # objects built for a different -march=native expansion. | |
| restore-keys: | | |
| ${{ github.workflow }}-cpp-ubuntu-simd-${{ matrix.simd }}-${{ matrix.mode == '' && 'opt' || 'dev' }} | |
| max-size: 2G | |
| - name: Reset ccache stats | |
| run: ccache --zero-stats | |
| - name: Set up pixi | |
| uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.9.5 | |
| with: | |
| cache: true | |
| - name: Check code formatting | |
| run: | | |
| pixi run lint-check | |
| - name: Build and test Momentum | |
| run: | | |
| MOMENTUM_BUILD_PYMOMENTUM=$MOMENTUM_BUILD_PYMOMENTUM \ | |
| MOMENTUM_ENABLE_SIMD=$MOMENTUM_ENABLE_SIMD \ | |
| pixi run test${{ matrix.mode }} | |
| - name: Install Momentum and Build hello_world | |
| run: | | |
| MOMENTUM_BUILD_PYMOMENTUM=$MOMENTUM_BUILD_PYMOMENTUM \ | |
| MOMENTUM_ENABLE_SIMD=$MOMENTUM_ENABLE_SIMD \ | |
| pixi run install_no_build | |
| pixi run cmake \ | |
| -S momentum/examples/hello_world \ | |
| -B momentum/examples/hello_world/build \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| pixi run cmake --build momentum/examples/hello_world/build | |
| - name: Print ccache stats | |
| if: always() | |
| run: ccache --show-stats --verbose | |
| pymomentum: | |
| name: py-py312-ubuntu | |
| runs-on: ubuntu-latest | |
| env: | |
| CMAKE_C_COMPILER_LAUNCHER: ccache | |
| CMAKE_CXX_COMPILER_LAUNCHER: ccache | |
| CCACHE_EXTRAFILES: /tmp/native-cpu.txt | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Record native CPU for ccache | |
| run: | | |
| lscpu | sed -n '/^Model name:/p;/^Flags:/p' > /tmp/native-cpu.txt | |
| - name: Set up ccache | |
| uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 | |
| with: | |
| key: ${{ github.workflow }}-py312-ubuntu | |
| # ccache-action appends a timestamp when saving; restore keys are the | |
| # timestamp-free prefixes. Native CPU information belongs in | |
| # CCACHE_EXTRAFILES so one archive can contain entries for multiple | |
| # GitHub runner CPU variants while ccache still rejects objects built | |
| # for a different -march=native expansion. | |
| restore-keys: | | |
| ${{ github.workflow }}-py312-ubuntu | |
| max-size: 2G | |
| - name: Reset ccache stats | |
| run: ccache --zero-stats | |
| - name: Set up pixi | |
| uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.9.5 | |
| with: | |
| environments: py312 | |
| cache: true | |
| - name: Build and test PyMomentum | |
| run: | | |
| pixi run -e py312 test_py | |
| - name: Build Python API Doc | |
| run: | | |
| pixi run -e py312 doc_py_no_build | |
| - name: Upload Python API Doc | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: python-api-doc | |
| path: build/python_api_doc | |
| retention-days: 7 | |
| - name: Print ccache stats | |
| if: always() | |
| run: ccache --show-stats --verbose |