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 CI for compilation on multiple platforms (Linux, macoOS, Windows) #29

Merged
merged 7 commits into from
Aug 9, 2023
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 .github/workflows/apt.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: C++ CI Workflow

on:
push:
workflow_dispatch:
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/conda-forge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: C++ CI Workflow

on:
workflow_dispatch:
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-with-conda-dependencies:
name: '[conda:${{ matrix.os }}]'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build_type: [Release]
os: [ubuntu-22.04, macos-latest, windows-2019]

steps:
- uses: actions/checkout@v3

- name: Print used environment (no conda)
shell: bash -l {0}
run: |
env

- uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci_env.yml

# Additional dependencies useful only on Linux
- name: Additional Dependencies (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
micromamba install expat-cos6-x86_64 freeglut 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 mesa-libgl-cos6-x86_64 mesa-libgl-devel-cos6-x86_64

- name: Configure VS Toolchain (Windows)
if: contains(matrix.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1.12.1

- name: Setup compilation env variables (Windows)
if: contains(matrix.os, 'windows')
shell: bash -l {0}
run: |
bash_vc_install=${VCToolsInstallDir//\\//}
compiler_path=${bash_vc_install}bin/Hostx64/x64/cl.exe
echo "CC=${compiler_path}" >> $GITHUB_ENV
echo "CXX=${compiler_path}" >> $GITHUB_ENV

- name: Configure
shell: bash -l {0}
run: |
mkdir -p build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DBUILD_TESTING:BOOL=ON ..

- 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 --repeat until-pass:5 --output-on-failure -C ${{ matrix.build_type }} .

# This is commented until we fix https://github.com/robotology/gz-yarp-plugins/issues/28
# - name: Install
# run: |
# cd build
# cmake --build . --config ${{ matrix.build_type }} --target install
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})
gz_find_package(gz-sim7 REQUIRED)
set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})

# Support shared libraries on Windows
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

add_subdirectory(libraries)
add_subdirectory(plugins)
Expand Down
11 changes: 11 additions & 0 deletions ci_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: gzyarppluginsdev
channels:
- conda-forge
dependencies:
- cmake
- compilers
- make
- ninja
- pkg-config
- libgz-sim7
- yarp
1 change: 1 addition & 0 deletions plugins/camera/singleton-camera/Handler.hh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <mutex>
#include <string>
#include <yarp/dev/PolyDriver.h>
#include <yarp/dev/PolyDriverList.h>
#include <gz/common/Event.hh>
Expand Down
2 changes: 2 additions & 0 deletions plugins/forcetorque/singleton-forcetorque/Handler.hh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <array>
#include <mutex>
#include <string>
#include <yarp/dev/PolyDriver.h>
#include <yarp/dev/PolyDriverList.h>
#include <gz/common/Event.hh>
Expand Down
2 changes: 2 additions & 0 deletions plugins/imu/singleton-imu/Handler.hh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <array>
#include <mutex>
#include <string>
#include <yarp/dev/PolyDriver.h>
#include <yarp/dev/PolyDriverList.h>
#include <gz/common/Event.hh>
Expand Down
2 changes: 2 additions & 0 deletions plugins/laser/singleton-laser/Handler.hh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <mutex>
#include <string>
#include <vector>
#include <yarp/dev/PolyDriver.h>
#include <yarp/dev/PolyDriverList.h>
#include <gz/common/Event.hh>
Expand Down
Loading