Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add macOS and Ninja jobs to GitHub Actions #276

Merged
merged 9 commits into from
Nov 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/install_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apt-get update
export DEBIAN_FRONTEND=noninteractive

# CI specific packages
apt-get install -y clang valgrind ccache
apt-get install -y clang valgrind ccache ninja-build

# Core dependencies
apt-get install -y libeigen3-dev build-essential cmake cmake-curses-gui coinor-libipopt-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libtinyxml-dev libace-dev libedit-dev libgsl0-dev libopencv-dev libode-dev liblua5.1-dev lua5.1 git swig qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev qml-module-qtquick2 qml-module-qtquick-window2 qml-module-qtmultimedia qml-module-qtquick-dialogs qml-module-qtquick-controls qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings libsdl1.2-dev libxml2-dev
Expand Down
48 changes: 36 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,20 @@ jobs:
matrix:
build_type: [Debug, Release]
project_tags: [Stable, Unstable]
os: [ubuntu-latest]
os: [ubuntu-latest, macOS-10.14]
include:
- os: ubuntu-latest
build_type: Debug
cmake_generator: "Ninja"
- os: ubuntu-latest
build_type: Release
cmake_generator: "Unix Makefiles"
- os: macOS-10.14
build_type: Debug
cmake_generator: "Unix Makefiles"
- os: macOS-10.14
build_type: Release
cmake_generator: "Xcode"

diegoferigo marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@master
Expand All @@ -44,12 +57,19 @@ jobs:
sudo ./.ci/install_debian.sh

- name: Dependencies [MacOS]
if: matrix.os == 'macOS-latest'
if: matrix.os == 'macOS-10.14'
run: |
brew install ace asio eigen tinyxml swig qt5 gsl pkg-config jpeg tinyxml
# Understand how to export env variables in a os-specific way
export Qt5_DIR=/usr/local/opt/qt5/lib/cmake/Qt5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curiosity: is this no longer necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea, but I wanted to test it.

Copy link
Member Author

@traversaro traversaro Nov 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently it is not necessary anymore, as the test are successful even without setting it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently it is still necessary, as without it the Qt5 GUI are skipped, see in the log:

2019-11-07T17:11:17.9116700Z -- Qt5 and GTK2 not found/selected, skipping iCubSkinGui
2019-11-07T17:11:17.9117690Z -- Qt5 and GTK2 not found/selected, skipping frameGrabberGui2
2019-11-07T17:11:17.9118630Z -- Qt5 and GTK2 not found/selected, skipping skinManagerGui

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diegoferigo any idea on how to set export Qt5_DIR=/usr/local/opt/qt5/lib/cmake/Qt5 only for a macos runner without duplicating the build step?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there's an undocumented method that is all but future proof:

- name: Setting env var
  if: matrix.os == macOS-10.14
  run: |
    echo "::set-env name=Qt5_DIR::/path/to/dir"
    env

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah cool. For the time being I just set Qt5_DIR to /usr/local/opt/qt5/lib/cmake/Qt5 also in Linux, as /usr/local/opt/qt5/lib/cmake/Qt5 is an empty directory in Linux and qt is found just by using the system paths, but this method may be useful.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks for letting me know! Also the logger support is quite interesting


cmake --version
brew cask install xquartz
# Core dependencies
brew install ace boost cmake eigen gsl ipopt jpeg libedit opencv@3 pkg-config qt5 sqlite swig tinyxml
# ROBOTOLOGY_ENABLE_DYNAMICS dependencies
brew install libmatio
# ROBOTOLOGY_USES_GAZEBO dependencies
brew install osrf/simulation/gazebo10
# CI-specific dependencies
brew install ninja
cmake --version

# ===================
# CMAKE-BASED PROJECT
Expand All @@ -62,16 +82,20 @@ jobs:
mkdir -p build
cd build
# Note: HUMAN_DYNAMICS is temporary disabled as a workaround for https://github.com/robotology/wearables/issues/56
cmake -DROBOTOLOGY_USES_GAZEBO:BOOL=ON -DROBOTOLOGY_USES_OCTAVE:BOOL=ON -DROBOTOLOGY_USES_PYTHON:BOOL=ON -DROBOTOLOGY_ENABLE_DYNAMICS:BOOL=ON -DROBOTOLOGY_ENABLE_HUMAN_DYNAMICS:BOOL=OFF -DROBOTOLOGY_ENABLE_ICUB_HEAD:BOOL=ON -DNON_INTERACTIVE_BUILD:BOOL=TRUE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DROBOTOLOGY_PROJECT_TAGS=${{ matrix.project_tags }} ..
cmake -G"${{ matrix.cmake_generator }}" -DROBOTOLOGY_USES_GAZEBO:BOOL=ON -DROBOTOLOGY_USES_OCTAVE:BOOL=ON -DROBOTOLOGY_USES_PYTHON:BOOL=ON -DROBOTOLOGY_ENABLE_DYNAMICS:BOOL=ON -DROBOTOLOGY_ENABLE_HUMAN_DYNAMICS:BOOL=OFF -DROBOTOLOGY_ENABLE_ICUB_HEAD:BOOL=ON -DNON_INTERACTIVE_BUILD:BOOL=TRUE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..

- name: Ubuntu-specific Configure [Ubuntu]
if: matrix.os == 'ubuntu-latest'
run: |
cd build
cmake -DROBOTOLOGY_USES_GAZEBO:BOOL=ON .
- name: Disable macOS unsupported options
if: matrix.os == 'macOS-10.14'
run: |
cd build
# Disable ROBOTOLOGY_USES_PYTHON in macOS
cmake -DROBOTOLOGY_USES_OCTAVE:BOOL=OFF -DROBOTOLOGY_USES_PYTHON:BOOL=OFF .

- name: Build
shell: bash
run: |
cd build
cmake --build . --config ${{ matrix.build_type }}
env:
# This is necessary only on macOS/homebrew, but on Linux it should be ignored
Qt5_DIR: /usr/local/opt/qt5/lib/cmake/Qt5
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ endif()
# Bootstrap YCM
set(YCM_FOLDER robotology)
set(YCM_COMPONENT core)
set(YCM_TAG v0.10.4)
# Temporary fix for https://github.com/robotology/ycm/issues/290
if("${CMAKE_GENERATOR}" MATCHES "Ninja" OR ("${CMAKE_GENERATOR}" MATCHES "Xcode"))
set(YCM_TAG 6f7cc07c97d9016de5bbdeba13eeb93bd4bc8b65)
else()
set(YCM_TAG v0.10.4)
endif()
set(YCM_MINIMUM_VERSION 0.10.4)
include(YCMBootstrap)

Expand Down