From 84782c76aca731b3b88609bf4a531cbe9f141de2 Mon Sep 17 00:00:00 2001 From: ManifoldFR Date: Wed, 15 May 2024 17:00:49 +0200 Subject: [PATCH 1/7] Add conda linux workflow --- .github/workflows/conda/conda-env.yml | 15 ++++++ .github/workflows/linux-conda.yml | 78 +++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 .github/workflows/conda/conda-env.yml create mode 100644 .github/workflows/linux-conda.yml diff --git a/.github/workflows/conda/conda-env.yml b/.github/workflows/conda/conda-env.yml new file mode 100644 index 0000000..7f1c0de --- /dev/null +++ b/.github/workflows/conda/conda-env.yml @@ -0,0 +1,15 @@ + +name: pinocchio-rerun +channels: + - conda-forge +dependencies: + - python + - cmake + - ninja + - cxx-compiler + - ccache + - pinocchio + - eigen + - librerun-sdk + - fmt + - example-robot-data diff --git a/.github/workflows/linux-conda.yml b/.github/workflows/linux-conda.yml new file mode 100644 index 0000000..7ee8076 --- /dev/null +++ b/.github/workflows/linux-conda.yml @@ -0,0 +1,78 @@ +name: CI on Linux via Conda + +on: + push: + branches: + - main + paths-ignore: + - '*.md' + - '.gitignore' + pull_request: + paths-ignore: + - '*.md' + - '.gitignore' + +jobs: + pinocchio-rerun: + name: ${{ matrix.os }} - Python ${{ matrix.python-version }} ${{ matrix.build_type }} + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash -el {0} + + env: + CCACHE_BASEDIR: "${GITHUB_WORKSPACE}" + CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache" + CCACHE_COMPRESS: true + CCACHE_COMPRESSLEVEL: 6 + + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest"] + build_type: [Release, Debug] + python-version: ["3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - uses: actions/cache@v3 + with: + path: .ccache + key: ccache-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ github.sha }} + restore-keys: ccache-conda-${{ matrix.os }}-${{ matrix.build_type }}- + + - uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: pinrerun + auto-update-conda: true + environment-file: .github/workflows/conda/conda-env.yml + python-version: ${{ matrix.python-version }} + + - name: Build + run: | + conda activate pinrerun + echo $CONDA_PREFIX + + mkdir build && cd build + + cmake .. \ + -GNinja \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DPYTHON_EXECUTABLE=$(which python3) \ + -DBUILD_PYTHON_INTERFACE=ON \ + -DBUILD_DOCUMENTATION=OFF \ + -DGENERATE_PYTHON_STUBS=ON + cmake --build . + ctest --output-on-failure + cmake --install . + + - name: Uninstall pinrerun + run: | + conda activate pinrerun + cd build + cmake --build . --target uninstall From 2352c2a58c7d52d0962696fac79b632e2e5c2b12 Mon Sep 17 00:00:00 2001 From: ManifoldFR Date: Wed, 15 May 2024 17:16:09 +0200 Subject: [PATCH 2/7] Upgrade actions/cache --- .github/workflows/linux-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-conda.yml b/.github/workflows/linux-conda.yml index 7ee8076..c35c352 100644 --- a/.github/workflows/linux-conda.yml +++ b/.github/workflows/linux-conda.yml @@ -38,7 +38,7 @@ jobs: with: submodules: recursive - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: .ccache key: ccache-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ github.sha }} From ae67555ef92371db8fcf158d5fe68fe1feeb4c21 Mon Sep 17 00:00:00 2001 From: ManifoldFR Date: Wed, 15 May 2024 17:23:44 +0200 Subject: [PATCH 3/7] Checkout and build pinochio-visualizers --- .github/workflows/linux-conda.yml | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux-conda.yml b/.github/workflows/linux-conda.yml index c35c352..5319522 100644 --- a/.github/workflows/linux-conda.yml +++ b/.github/workflows/linux-conda.yml @@ -12,13 +12,14 @@ on: - '*.md' - '.gitignore' +defaults: + run: + shell: bash -el {0} + jobs: pinocchio-rerun: name: ${{ matrix.os }} - Python ${{ matrix.python-version }} ${{ matrix.build_type }} runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -el {0} env: CCACHE_BASEDIR: "${GITHUB_WORKSPACE}" @@ -38,6 +39,13 @@ jobs: with: submodules: recursive + - name: Checkout pinocchio-visualizers + uses: actions/checkout@v4 + with: + repository: ManifoldFR/pinocchio-visualizers + submodules: recursive + path: ./visualizers + - uses: actions/cache@v4 with: path: .ccache @@ -51,10 +59,22 @@ jobs: environment-file: .github/workflows/conda/conda-env.yml python-version: ${{ matrix.python-version }} - - name: Build + - name: Build pinocchio-visualizers + run: | + cd ./visualizers + conda activate pinrerun + mkdir build && cd build + + cmake .. \ + -GNinja \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + cmake --build . --target install + + - name: Build pinrerun run: | conda activate pinrerun - echo $CONDA_PREFIX mkdir build && cd build From a4cbd58db170643453dba5916e25631e1a39462a Mon Sep 17 00:00:00 2001 From: ManifoldFR Date: Wed, 15 May 2024 17:30:19 +0200 Subject: [PATCH 4/7] Add gtest to conda env --- .github/workflows/conda/conda-env.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/conda/conda-env.yml b/.github/workflows/conda/conda-env.yml index 7f1c0de..2e9da29 100644 --- a/.github/workflows/conda/conda-env.yml +++ b/.github/workflows/conda/conda-env.yml @@ -8,6 +8,7 @@ dependencies: - ninja - cxx-compiler - ccache + - gtest - pinocchio - eigen - librerun-sdk From 12f81549f96847fc86aec8953e913866b1b37720 Mon Sep 17 00:00:00 2001 From: ManifoldFR Date: Wed, 15 May 2024 17:31:10 +0200 Subject: [PATCH 5/7] Add check step --- .github/workflows/linux-conda.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux-conda.yml b/.github/workflows/linux-conda.yml index 5319522..5b1a6dc 100644 --- a/.github/workflows/linux-conda.yml +++ b/.github/workflows/linux-conda.yml @@ -17,7 +17,7 @@ defaults: shell: bash -el {0} jobs: - pinocchio-rerun: + pinocchio-rerun-conda: name: ${{ matrix.os }} - Python ${{ matrix.python-version }} ${{ matrix.build_type }} runs-on: ${{ matrix.os }} @@ -96,3 +96,18 @@ jobs: conda activate pinrerun cd build cmake --build . --target uninstall + + check: + if: always() + name: check-linux-conda + + needs: + - pinocchio-rerun-conda + + 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) }} From 989c115acad2c649ac567ca46c7ecf47eabafdf2 Mon Sep 17 00:00:00 2001 From: ManifoldFR Date: Wed, 15 May 2024 17:33:53 +0200 Subject: [PATCH 6/7] Update PROJECT_URL --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c4bf0e..d6aa782 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.18) set(PROJECT_NAME septum) -set(PROJECT_URL "https://github.com/ManifoldFR/pin-viz-cpp") +set(PROJECT_URL "https://github.com/ManifoldFR/pinocchio-rerun") set(PROJECT_DESCRIPTION "A C++-based visualizer for Pinocchio using rerun") set(PROJECT_CUSTOM_HEADER_EXTENSION "hpp") set(PROJECT_VERSION 0.1.0) From 1b29c583ce5431b9fe69a93d748881691a3fde31 Mon Sep 17 00:00:00 2001 From: ManifoldFR Date: Wed, 15 May 2024 17:35:01 +0200 Subject: [PATCH 7/7] Add rerun-sdk (Python) to conda env --- .github/workflows/conda/conda-env.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/conda/conda-env.yml b/.github/workflows/conda/conda-env.yml index 2e9da29..cef866c 100644 --- a/.github/workflows/conda/conda-env.yml +++ b/.github/workflows/conda/conda-env.yml @@ -11,6 +11,7 @@ dependencies: - gtest - pinocchio - eigen + - rerun-sdk - librerun-sdk - fmt - example-robot-data