From c97ed8dd281cb5ff9af0bf5641c99b21b924be71 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 22 Apr 2021 17:11:58 +0200 Subject: [PATCH 1/3] Add conda-based Continuous Integration --- .github/workflows/conda-ci.yml | 66 ++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/conda-ci.yml diff --git a/.github/workflows/conda-ci.yml b/.github/workflows/conda-ci.yml new file mode 100644 index 0000000..1c790c0 --- /dev/null +++ b/.github/workflows/conda-ci.yml @@ -0,0 +1,66 @@ +name: C++ CI Workflow with conda dependencies + +on: + push: + pull_request: + schedule: + # * is a special character in YAML so you have to quote this string + # Execute a "nightly" build at 2 AM UTC + - cron: '0 2 * * *' + +jobs: + build: + name: '[${{ matrix.os }}@${{ matrix.build_type }}@conda]' + runs-on: ${{ matrix.os }} + strategy: + matrix: + build_type: [Release] + os: [ubuntu-latest, windows-latest, macos-latest] + fail-fast: false + + steps: + - uses: actions/checkout@v2 + + - uses: conda-incubator/setup-miniconda@v2 + with: + mamba-version: "*" + channels: conda-forge,defaults + channel-priority: true + + - name: Dependencies + shell: bash -l {0} + run: | + # Compilation related dependencies + mamba install cmake compilers make ninja pkg-config + # Actual dependencies + mamba install -c robotology yarp icub-main gazebo icub-contrib-common qt opencv + + - name: Configure [Linux&macOS] + if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') + shell: bash -l {0} + run: | + mkdir -p build + cd build + cmake -GNinja -DBUILD_TESTING:BOOL=ON \ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. + + - name: Configure [Windows] + if: contains(matrix.os, 'windows') + shell: bash -l {0} + run: | + mkdir -p build + cd build + cmake -G"Visual Studio 16 2019" -DBUILD_TESTING:BOOL=ON \ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. + + - name: Build + shell: bash -l {0} + run: | + cd build + cmake --build . --config ${{ matrix.build_type }} + + - name: Test + shell: bash -l {0} + run: | + cd build + ctest --output-on-failure -C ${{ matrix.build_type }} From 0cf93358a038463dd5fe5925cee397fff0e7fbf7 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 22 Apr 2021 17:20:48 +0200 Subject: [PATCH 2/3] Update conda-ci.yml --- .github/workflows/conda-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/conda-ci.yml b/.github/workflows/conda-ci.yml index 1c790c0..bc33323 100644 --- a/.github/workflows/conda-ci.yml +++ b/.github/workflows/conda-ci.yml @@ -34,6 +34,16 @@ jobs: mamba install cmake compilers make ninja pkg-config # Actual dependencies mamba install -c robotology yarp icub-main gazebo icub-contrib-common qt opencv + + # Additional dependencies useful only on Linux when using Qt + - name: Dependencies [Conda/Linux] + if: contains(matrix.os, 'ubuntu') + shell: bash -l {0} + run: | + # Additional dependencies only useful on Linux + # See https://github.com/robotology/robotology-superbuild/issues/477 + mamba install expat-cos6-x86_64 libselinux-cos6-x86_64 libxau-cos6-x86_64 libxcb-cos6-x86_64 libxdamage-cos6-x86_64 libxext-cos6-x86_64 libxfixes-cos6-x86_64 libxxf86vm-cos6-x86_64 mesalib mesa-libgl-cos6-x86_64 + - name: Configure [Linux&macOS] if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') From 80bb8eaf8fe57c5f7efb73da5af27242a77ad004 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 22 Apr 2021 17:49:20 +0200 Subject: [PATCH 3/3] Add target_link_directories GAZEBO_LIBRARY_DIRS to library that uses Gazebo --- demoRedBall/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/demoRedBall/CMakeLists.txt b/demoRedBall/CMakeLists.txt index b537216..c683e1d 100644 --- a/demoRedBall/CMakeLists.txt +++ b/demoRedBall/CMakeLists.txt @@ -28,6 +28,7 @@ if (GAZEBO_FOUND) add_library(${PROJECT_NAME}-world SHARED src/world.cpp) target_compile_definitions(${PROJECT_NAME}-world PRIVATE _USE_MATH_DEFINES) target_include_directories(${PROJECT_NAME}-world PRIVATE ${GAZEBO_INCLUDE_DIRS}) + target_link_directories(${PROJECT_NAME}-world PRIVATE ${GAZEBO_LIBRARY_DIRS}) target_link_libraries(${PROJECT_NAME}-world PRIVATE ${GAZEBO_LIBRARIES} ${YARP_LIBRARIES}) install(TARGETS ${PROJECT_NAME}-world LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib) add_subdirectory(gazebo)