Skip to content

Commit

Permalink
Add conda-forge CI test (#930)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwason authored Aug 29, 2023
1 parent 6d6d917 commit 1e25fba
Show file tree
Hide file tree
Showing 12 changed files with 322 additions and 64 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Conda

on:
push:
branches:
- master
- 'dev**'
pull_request:
paths:
- 'tesseract**'
- '.github/workflows/conda.yml'
- '**.repos'
release:
types:
- released

jobs:
conda-win:
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
with:
path: workspace/src/tesseract
- name: install-depends
shell: cmd
run: |
python -m pip install vcstool -q
- name: vcs import
run: >
vcs import --input "${{ github.workspace }}/workspace/src/tesseract/.github/workflows/windows_dependencies.repos" workspace/src/
- uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
channel-priority: true
channels: conda-forge
python-version: "3.10"
use-mamba: true
- name: conda install
run: >
mamba install boa conda-smithy -y
- name: build and test
run: |
mkdir conda
xcopy /E workspace\src\tesseract\.github\workflows\conda conda
cd conda
New-Item -Name conda-forge.yml -ItemType File
conda smithy regenerate
mamba mambabuild -m .ci_support/win_64_.yaml .
conda-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: workspace/src/tesseract
- name: install-depends
run: |
python -m pip install vcstool -q
- name: vcs import
run: >
vcs import --input "${{ github.workspace }}/workspace/src/tesseract/.github/workflows/windows_dependencies.repos" workspace/src/
- uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
channel-priority: true
channels: conda-forge
python-version: "3.10"
use-mamba: true
- name: conda install
run: >
mamba install boa conda-smithy -y
- name: build and test
run: |
cp -r workspace/src/tesseract/.github/workflows/conda ./conda
cd conda
touch conda-forge.yml
conda smithy regenerate
mamba mambabuild -m .ci_support/linux_64_.yaml .
5 changes: 5 additions & 0 deletions .github/workflows/conda/recipe/activate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@if not defined CONDA_PREFIX goto:eof

@call "%CONDA_PREFIX%\opt\tesseract_robotics\setup.bat"

@set TESSERACT_PYTHON_DLL_PATH=%CONDA_PREFIX%\opt\tesseract_robotics\bin
1 change: 1 addition & 0 deletions .github/workflows/conda/recipe/activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source "${CONDA_PREFIX}/opt/tesseract_robotics/setup.sh"
32 changes: 32 additions & 0 deletions .github/workflows/conda/recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
set CXXFLAGS=%CXXFLAGS% -DEIGEN_DONT_ALIGN=1 -DEIGEN_DONT_VECTORIZE=1
set CXXFLAGS=%CXXFLAGS% /std:c++17

call colcon build --merge-install --install-base="%PREFIX%\opt\tesseract_robotics" ^
--event-handlers console_cohesion+ ^
--packages-ignore gtest osqp osqp_eigen tesseract_examples trajopt_ifopt trajopt_sqp ^
--cmake-args -GNinja -DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="/MD /O2 /Ob0 /Zi /DNDEBUG" ^
-DCMAKE_RELWITHDEBINFO_POSTFIX="" ^
-DBUILD_SHARED_LIBS=ON ^
-DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON ^
-DBUILD_IPOPT=OFF ^
-DBUILD_SNOPT=OFF ^
-DCMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^
-DTESSERACT_ENABLE_CLANG_TIDY=OFF ^
-DTESSERACT_ENABLE_CODE_COVERAGE=OFF ^
-DPYTHON_EXECUTABLE="%PREFIX%\python.exe" ^
-DTESSERACT_ENABLE_EXAMPLES=OFF ^
-DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF ^

if %errorlevel% neq 0 exit /b %errorlevel%

setlocal EnableDelayedExpansion

:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d.
:: This will allow them to be run on environment activation.
for %%F in (activate deactivate) DO (
if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d
copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat
)

if %errorlevel% neq 0 exit /b %errorlevel%
29 changes: 29 additions & 0 deletions .github/workflows/conda/recipe/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
set -e

ln -s $BUILD_PREFIX/bin/x86_64-conda-linux-gnu-gcc $BUILD_PREFIX/bin/gcc

colcon build --merge-install --install-base="$PREFIX/opt/tesseract_robotics" \
--event-handlers console_cohesion+ \
--packages-ignore gtest osqp osqp_eigen tesseract_examples trajopt_ifopt trajopt_sqp \
--cmake-args -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_IPOPT=OFF \
-DBUILD_SNOPT=OFF \
-DCMAKE_PREFIX_PATH:PATH="$PREFIX" \
-DTESSERACT_ENABLE_CLANG_TIDY=OFF \
-DTESSERACT_ENABLE_CODE_COVERAGE=OFF \
-DTESSERACT_ENABLE_EXAMPLES=OFF \
-DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF \
-DSETUPTOOLS_DEB_LAYOUT=OFF \
-DTESSERACT_ENABLE_TESTING=ON

colcon test --event-handlers console_direct+ --return-code-on-test-failure \
--packages-ignore gtest osqp osqp_eigen tesseract_examples trajopt_ifopt trajopt_sqp tesseract_common \
--merge-install --install-base="$PREFIX/opt/tesseract_robotics"


for CHANGE in "activate" "deactivate"
do
mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d"
cp "${RECIPE_DIR}/${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh"
done
Empty file.
Empty file.
71 changes: 71 additions & 0 deletions .github/workflows/conda/recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package:
name: tesseract
version: "0.1.0"

source:
path: ../../workspace

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- gtest
- gmock
- cmake
- ninja # [win]
- make # [linux]
- pkg-config
- swig
- colcon-common-extensions
- lcov
- {{ cdt('mesa-libgl-devel') }} # [linux]
- {{ cdt('mesa-dri-drivers') }} # [linux]
host:
- boost-cpp
- eigen
- tinyxml2
- console_bridge
- assimp
- urdfdom
- fcl
- octomap
- orocos-kdl
- pcl
- gtest
- gmock
- pkg-config
- xz
- flann
- jsoncpp
- yaml-cpp
- bullet-cpp
- xorg-libx11 # [unix]
- xorg-libxext # [unix]
run:
- boost-cpp
- eigen
- tinyxml2
- console_bridge
- assimp
- urdfdom
- fcl
- octomap
- orocos-kdl
- pcl
- gtest
- gmock
- xz
- jsoncpp
- taskflow
- yaml-cpp
- bullet-cpp
- xorg-libx11 # [unix]
- xorg-libxext # [unix]

build:
skip: true # [py<37]
number: 0

about:
home: https://github.com/ros-industrial-consortium/tesseract
summary: Tesseract robotics motion planning framework
4 changes: 1 addition & 3 deletions tesseract_geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ find_package(console_bridge REQUIRED)
find_package(tesseract_common REQUIRED)
find_package(octomap REQUIRED)
find_package(assimp REQUIRED)
link_directories(${assimp_LIBRARY_DIRS})

if(NOT TARGET console_bridge::console_bridge)
add_library(console_bridge::console_bridge INTERFACE IMPORTED)
Expand Down Expand Up @@ -84,7 +83,7 @@ target_link_libraries(
console_bridge::console_bridge
octomap
octomath
${assimp_LIBRARIES})
assimp::assimp)
target_compile_options(${PROJECT_NAME} PUBLIC ${TESSERACT_COMPILE_OPTIONS_PUBLIC})
target_compile_definitions(${PROJECT_NAME} PUBLIC ${TESSERACT_COMPILE_DEFINITIONS} ${TESSERACT_ASSIMP_USE_PBRMATERIAL})
target_clang_tidy(${PROJECT_NAME} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY})
Expand All @@ -97,7 +96,6 @@ target_code_coverage(
ENABLE ${TESSERACT_ENABLE_CODE_COVERAGE})
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE ${assimp_INCLUDE_DIRS})

configure_package(NAMESPACE tesseract TARGETS ${PROJECT_NAME})

Expand Down
Loading

0 comments on commit 1e25fba

Please sign in to comment.