-
Notifications
You must be signed in to change notification settings - Fork 48
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 automatic generation of conda binary packages for Windows, macOS and Linux in robotology channel #652
Add automatic generation of conda binary packages for Windows, macOS and Linux in robotology channel #652
Changes from 12 commits
d520cb2
fa364e8
15b5647
5078361
d504067
553bd5d
05593fd
903aa77
c989941
f0c615e
cfe30cd
2b0d329
7b1fa58
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: Generate conda packages | ||
# This action automatically generate conda packages for the packages in the robotology-superbuild | ||
# Check doc/conda-recipe-generation.md for more info | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# Run the job once a week | ||
- cron: '0 0 * * 2' | ||
|
||
jobs: | ||
generate-conda-packages: | ||
name: "Generate conda packages @${{ matrix.os }}" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
conda_platform: linux-64 | ||
- os: macos-latest | ||
conda_platform: osx-64 | ||
- os: windows-2019 | ||
conda_platform: win-64 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
mamba-version: "*" | ||
channels: conda-forge | ||
channel-priority: true | ||
python-version: "3.8" | ||
|
||
- name: Install files to enable compilation of mex files [Conda/Linux] | ||
if: contains(matrix.os, 'ubuntu') | ||
run: | | ||
curl -L -O https://github.com/robotology/robotology-vcpkg-ports/releases/download/storage/msdk_R2020b_mexa64.zip | ||
unzip msdk_R2020b_mexa64.zip | ||
rm msdk_R2020b_mexa64.zip | ||
echo "GHA_Matlab_ROOT_DIR=${GITHUB_WORKSPACE}/msdk_R2020b_mexa64" >> $GITHUB_ENV | ||
echo "GHA_Matlab_MEX_EXTENSION=mexa64" >> $GITHUB_ENV | ||
|
||
- name: Install files to enable compilation of mex files [Conda/macOS] | ||
if: contains(matrix.os, 'macos') | ||
run: | | ||
curl -L -O https://github.com/robotology/robotology-vcpkg-ports/releases/download/storage/msdk_R2020a_mexmaci64.zip | ||
unzip msdk_R2020a_mexmaci64.zip | ||
rm msdk_R2020a_mexmaci64.zip | ||
echo "GHA_Matlab_ROOT_DIR=${GITHUB_WORKSPACE}/msdk_R2020a_mexmaci64" >> $GITHUB_ENV | ||
echo "GHA_Matlab_MEX_EXTENSION=mexmaci64" >> $GITHUB_ENV | ||
|
||
- name: Install files to enable compilation of mex files [Conda/Windows] | ||
if: contains(matrix.os, 'windows') | ||
shell: bash | ||
run: | | ||
curl -L -O https://github.com/robotology/robotology-vcpkg-ports/releases/download/storage/msdk_R2020a_mexw64.zip | ||
unzip msdk_R2020a_mexw64.zip | ||
rm msdk_R2020a_mexw64.zip | ||
echo "GHA_Matlab_ROOT_DIR=${GITHUB_WORKSPACE}/msdk_R2020a_mexw64" >> $GITHUB_ENV | ||
echo "GHA_Matlab_MEX_EXTENSION=mexw64" >> $GITHUB_ENV | ||
|
||
# Python 3.8 is required by https://github.com/Anaconda-Platform/anaconda-client/pull/551 | ||
- name: Dependencies for conda recipes generation and upload | ||
shell: bash -l {0} | ||
run: | | ||
mamba install pyyaml jinja2 conda-build ninja anaconda-client | ||
python -m pip install git+https://github.com/wolfv/multisheller.git@0cc03c68d0c68d2f9cf7b07ddb68afa531419a6d | ||
|
||
- name: Generate recipes [Linux&macOS] | ||
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') | ||
shell: bash -l {0} | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -GNinja -C ${GITHUB_WORKSPACE}/.ci/initial-cache.gh.cmake -DYCM_EP_ADDITIONAL_CMAKE_ARGS:STRING="-DMatlab_ROOT_DIR:PATH=${GHA_Matlab_ROOT_DIR} -DMatlab_MEX_EXTENSION:STRING=${GHA_Matlab_MEX_EXTENSION}" -DROBOTOLOGY_USES_MATLAB:BOOL=ON -DROBOTOLOGY_PROJECT_TAGS=LatestRelease -DROBOTOLOGY_GENERATE_CONDA_RECIPES:BOOL=ON .. | ||
|
||
- name: Generate recipes [Windows] | ||
if: contains(matrix.os, 'windows') | ||
shell: bash -l {0} | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -G"Visual Studio 16 2019" -C ${GITHUB_WORKSPACE}/.ci/initial-cache.gh.cmake -DYCM_EP_ADDITIONAL_CMAKE_ARGS:STRING="-DMatlab_ROOT_DIR:PATH=${GHA_Matlab_ROOT_DIR} -DMatlab_MEX_EXTENSION:STRING=${GHA_Matlab_MEX_EXTENSION}" -DROBOTOLOGY_USES_MATLAB:BOOL=ON -DROBOTOLOGY_PROJECT_TAGS=LatestRelease -DROBOTOLOGY_GENERATE_CONDA_RECIPES:BOOL=ON .. | ||
|
||
# Disable options not tested on Conda for now | ||
# Reference issue: https://github.com/robotology/robotology-superbuild/issues/563 | ||
- name: Disable options not supported in conda | ||
shell: bash -l {0} | ||
run: | | ||
# Cleanup recipes | ||
rm -rf build/conda/generated_recipes | ||
# Re-generate | ||
cd build | ||
cmake -DROBOTOLOGY_USES_OCTAVE:BOOL=OFF -DROBOTOLOGY_USES_PYTHON:BOOL=OFF . | ||
|
||
- name: Build conda packages | ||
shell: bash -l {0} | ||
run: | | ||
cd build/conda/generated_recipes | ||
conda build -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml . | ||
- name: Upload conda packages | ||
shell: bash -l {0} | ||
env: | ||
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }} | ||
run: | | ||
cd ${CONDA_PREFIX}/conda-bld/${{ matrix.conda_platform}}/ | ||
ls *.tar.bz2 | ||
anaconda upload --skip-existing *.tar.bz2 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,5 @@ ycm_ep_helper(WBToolbox TYPE GIT | |
iDynTree | ||
qpOASES | ||
BlockFactory) | ||
|
||
set(WBToolbox_CONDA_DEPENDENCIES eigen) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,6 @@ | |
include(YCMEPHelper) | ||
include(FindOrBuildPackage) | ||
|
||
find_package(ACE QUIET) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of interest, doesn't that break non-conda builds? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
find_package(SQLite QUIET) | ||
find_package(Eigen3 QUIET) | ||
|
||
set(YARP_OPTIONAL_DEPS "") | ||
if(ROBOTOLOGY_ENABLE_ROBOT_TESTING) | ||
find_or_build_package(RobotTestingFramework QUIET) | ||
|
@@ -17,8 +13,6 @@ endif() | |
|
||
# Workaround for https://github.com/robotology/robotology-superbuild/issues/377 | ||
if(NOT APPLE) | ||
find_package(SQLite QUIET) | ||
list(APPEND YARP_OPTIONAL_DEPS SQLite) | ||
set(YARP_OPTIONAL_CMAKE_ARGS "") | ||
else() | ||
set(YARP_OPTIONAL_CMAKE_ARGS "-DYARP_USE_SYSTEM_SQLite:BOOL=OFF") | ||
|
@@ -51,8 +45,6 @@ ycm_ep_helper(YARP TYPE GIT | |
COMPONENT core | ||
FOLDER src | ||
DEPENDS YCM | ||
ACE | ||
Eigen3 | ||
${YARP_OPTIONAL_DEPS} | ||
CMAKE_ARGS -DYARP_COMPILE_GUIS:BOOL=ON | ||
-DYARP_USE_SYSTEM_SQLite:BOOL=ON | ||
|
@@ -89,3 +81,5 @@ ycm_ep_helper(YARP TYPE GIT | |
-DCREATE_LUA:BOOL=${ROBOTOLOGY_USES_LUA} | ||
-DENABLE_yarpmod_usbCamera:BOOL=${ENABLE_USBCAMERA} | ||
${YARP_OPTIONAL_CMAKE_ARGS}) | ||
|
||
set(YARP_CONDA_DEPENDENCIES ace opencv tinyxml qt eigen sdl sdl2 sqlite libjpeg-turbo) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This number needs to be increased at each full rebuild, | ||
# to ensure that binaries belonging to different rebuilds | ||
# can be distinguished even if the version number is the same | ||
set(CONDA_BUILD_NUMBER 0) | ||
|
||
# For more conda generation options, check the specific project Build<CMakeProject>.cmake | ||
# file for variables that start with `<CMakeProject>_CONDA` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've often seen "UNIX AND NOT APPLE" - not sure which one is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UNIX AND NOT APPLE
is typically used to include *bsd systems, as conda-forge do not support any *bsd or similar target at the moment I think it is more clear to indicate it as "do something if we are on linux". If conda-forge will ever support other non-Linux targets (such as WebAssembly ( pyodide/pyodide#795 ), that would be a dream!) we will eventually fix this.