diff --git a/.github/workflows/conda/environment_macos_linux.yml b/.github/workflows/conda/environment_macos_linux.yml deleted file mode 100644 index 9673c1fe5b..0000000000 --- a/.github/workflows/conda/environment_macos_linux.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: pinocchio -channels: - - conda-forge -dependencies: - - eigen=3.4.0 - - hpp-fcl - - numpy - - boost - - eigenpy - - urdfdom - - python - - cmake - - ccache - - pkg-config - - ninja - - llvm-openmp - - cxx-compiler - - meshcat-python - - casadi - - cppad<=20230000 - - cppadcodegen - - pycppad - - matplotlib - - mpfr - - qhull - - qhull-static - - libsdformat diff --git a/.github/workflows/conda/environment_windows.yml b/.github/workflows/conda/environment_windows.yml deleted file mode 100644 index 99569b5795..0000000000 --- a/.github/workflows/conda/environment_windows.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: pinocchio-windows -channels: - - conda-forge -dependencies: - - eigen=3.4.0 - - hpp-fcl - - numpy - - boost - - eigenpy - - urdfdom - - python - - cmake - - ccache - - pkg-config - - ninja - - cxx-compiler - - meshcat-python - - casadi - - cppad<=20230000 - - cppadcodegen - - pycppad - - matplotlib - - mpfr - - qhull - - libsdformat diff --git a/.github/workflows/macos-linux-conda.yml b/.github/workflows/macos-linux-windows-pixi.yml similarity index 68% rename from .github/workflows/macos-linux-conda.yml rename to .github/workflows/macos-linux-windows-pixi.yml index b14fa92fdd..0951d7ccb6 100644 --- a/.github/workflows/macos-linux-conda.yml +++ b/.github/workflows/macos-linux-windows-pixi.yml @@ -1,4 +1,4 @@ -name: CI - OSX/Linux via Conda +name: CI - MacOS/Linux/Windows via Pixi on: schedule: @@ -28,8 +28,8 @@ concurrency: cancel-in-progress: true jobs: - pinocchio-conda: - name: ${{ matrix.os }} - Python ${{ matrix.python-version }} ${{ matrix.build_type }} with Conda + pinocchio-pixi: + name: ${{ matrix.os }} - Env ${{ matrix.environment }} ${{ matrix.build_type }} ${{ matrix.compiler }} runs-on: ${{ matrix.os }} env: CCACHE_BASEDIR: ${GITHUB_WORKSPACE} @@ -41,16 +41,27 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, macos-13] + environment: [all, all-py39] build_type: [Release, Debug] - python-version: ['3.8', '3.12'] include: + # Disable BUILD_ADVANCED_TESTING as the test can take many time to run - os: ubuntu-latest BUILD_ADVANCED_TESTING: OFF - # Disable BUILD_ADVANCED_TESTING as the test can take many time to run - os: macos-latest BUILD_ADVANCED_TESTING: OFF + - os: macos-13 + BUILD_ADVANCED_TESTING: OFF + - os: windows-latest + environment: all + build_type: Release + BUILD_ADVANCED_TESTING: OFF + - os: windows-latest + environment: all-clang-cl + build_type: Release + BUILD_ADVANCED_TESTING: OFF + steps: # extract branch name or checkout devel branch for scheduled events @@ -71,18 +82,16 @@ jobs: - uses: actions/cache@v4 with: path: .ccache - save-always: true key: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.python-version }}-${{ github.sha }} restore-keys: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.python-version }}- - - uses: conda-incubator/setup-miniconda@v3 + - uses: prefix-dev/setup-pixi@v0.8.1 with: - activate-environment: pinocchio-linux - auto-update-conda: true - environment-file: .github/workflows/conda/environment_macos_linux.yml - python-version: ${{ matrix.python-version }} - auto-activate-base: false + pixi-version: v0.33.0 + cache: true + environments: ${{ matrix.environment }} + # Avoid filling all disk space with debug symbols - name: Setup CMAKE_TOOLCHAIN_FILE if: (contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')) && contains(matrix.build_type, 'Debug') run: | @@ -99,38 +108,29 @@ jobs: await script({github, context, core}) result-encoding: string - - name: Build Pinocchio - shell: bash -el {0} + - name: Build Pinocchio [MacOS/Linux/Windows] + env: + CMAKE_BUILD_PARALLEL_LEVEL: 2 + PINOCCHIO_BUILD_TYPE: ${{ matrix.build_type }} run: | - conda list - echo $CONDA_PREFIX - - mkdir build - cd build - - cmake .. \ - -G "Ninja" \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + # Launch configure but overwrite default options + pixi run -e ${{ matrix.environment }} configure \ -DBUILD_ADVANCED_TESTING=${{ env.BUILD_ADVANCED_TESTING }} \ ${{ steps.get_labels.outputs.cmakeFlags }} - cmake --build . -j2 - ctest --output-on-failure - cmake --install . + pixi run -e ${{ matrix.environment }} cmake --build build --target all + pixi run -e ${{ matrix.environment }} ctest --test-dir build --output-on-failure + pixi run -e ${{ matrix.environment }} cmake --install build - name: Uninstall Pinocchio - shell: bash -el {0} run: | - cd build - cmake --build . --target uninstall + cmake --build build --target uninstall check: if: always() - name: check-macos-linux-conda + name: check-macos-linux-windows-pixi needs: - - pinocchio-conda + - pinocchio-pixi runs-on: Ubuntu-latest diff --git a/.github/workflows/windows-conda.yml b/.github/workflows/windows-conda.yml deleted file mode 100644 index 85469f9306..0000000000 --- a/.github/workflows/windows-conda.yml +++ /dev/null @@ -1,145 +0,0 @@ -name: CI - Windows via Conda -on: - schedule: - - cron: '0 0 * * 1' - push: - paths-ignore: - - doc/** - - .gitlab-ci.yml - - .gitignore - - '*.md' - - CITATION.* - - COPYING.LESSER - - colcon.pkg - - .pre-commit-config.yaml - pull_request: - paths-ignore: - - doc/** - - .gitlab-ci.yml - - .gitignore - - '*.md' - - CITATION.* - - COPYING.LESSER - - colcon.pkg - - .pre-commit-config.yaml -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - name: ${{ matrix.os }} - ${{ matrix.compiler }} with Conda - runs-on: ${{ matrix.os }} - env: - CCACHE_BASEDIR: ${GITHUB_WORKSPACE} - CCACHE_DIR: ${GITHUB_WORKSPACE}/.ccache - CCACHE_COMPRESS: true - CCACHE_COMPRESSLEVEL: 5 - - strategy: - fail-fast: false - matrix: - os: [windows-2019] - compiler: [cl, clang-cl] - - steps: - # Extract branch name or set 'devel' branch for scheduled events - - name: Get branch name or checkout devel - shell: bash - run: | - if [ "$GITHUB_EVENT_NAME" == "schedule" ]; then - echo "BRANCH_NAME=devel" >> $GITHUB_ENV - echo "LABELS=build_all" >> $GITHUB_ENV - else - branchName=${GITHUB_REF#refs/heads/} - echo "BRANCH_NAME=$branchName" >> $GITHUB_ENV - fi - - - uses: actions/checkout@v4 - with: - ref: ${{ env.BRANCH_NAME }} - submodules: recursive - - - uses: actions/cache@v4 - with: - path: .ccache - save-always: true - key: ccache-windows-conda-${{ matrix.compiler }}-${{ matrix.os }}-${{ github.sha }} - restore-keys: ccache-windows-conda-${{ matrix.compiler }}-${{ matrix.os }}- - - - uses: conda-incubator/setup-miniconda@v3 - with: - activate-environment: pinocchio - auto-update-conda: true - environment-file: .github/workflows/conda/environment_windows.yml - python-version: '3.10' - auto-activate-base: false - - - name: Get Compilation Flags - id: get_labels - uses: actions/github-script@v7 - env: - LABELS: ${{ env.LABELS }} - with: - script: | - const script = require('./.github/workflows/scripts/get_compilation_flags.js'); - await script({github, context, core}) - result-encoding: string - - - name: Build Pinocchio - shell: cmd /C CALL {0} - run: | - :: Set compiler to use. - :: This must be done here and not in env since - :: cxx-compiler activation script set this variable - :: and is called before. - set CC=${{ matrix.compiler }}.exe - set CXX=${{ matrix.compiler }}.exe - echo Compiler set to: %CC% - - call conda list - - :: Create build directory - mkdir build - pushd build - - :: Configure (Ninja use CC and CXX to determine the compiler) - cmake ^ - -G "Ninja" ^ - -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ - -DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ^ - -DCMAKE_BUILD_TYPE=Release ^ - ${{ steps.get_labels.outputs.cmakeFlags }} ^ - .. - - :: Build - cmake --build . -j2 - if errorlevel 1 exit 1 - - :: Testing - ctest --output-on-failure - if errorlevel 1 exit 1 - - :: Install - cmake --install . - - :: Test Python import - cd .. - python -c "import pinocchio" - if errorlevel 1 exit 1 - - check: - if: always() - name: check-windows-conda - - needs: - - build - - runs-on: Ubuntu-latest - - steps: - - name: Decide whether the needed jobs succeeded or failed - uses: re-actors/alls-green@release/v1 - with: - jobs: ${{ toJSON(needs) }} diff --git a/pixi.toml b/pixi.toml index 64238213ac..f693a4f929 100644 --- a/pixi.toml +++ b/pixi.toml @@ -43,6 +43,7 @@ configure = { cmd = [ "build", "-S", ".", + "-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX", "-DCMAKE_BUILD_TYPE=$PINOCCHIO_BUILD_TYPE", "-DGENERATE_PYTHON_STUBS=$PINOCCHIO_PYTHON_STUBS", "-DBUILD_WITH_COLLISION_SUPPORT=$PINOCCHIO_COLLISION_SUPPORT",