Skip to content

Commit 3f2c248

Browse files
authored
Add conda tests (#380)
1 parent 988c079 commit 3f2c248

File tree

14 files changed

+254
-3
lines changed

14 files changed

+254
-3
lines changed

.github/workflows/conda.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Conda
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- 'dev**'
8+
pull_request:
9+
release:
10+
types:
11+
- released
12+
13+
jobs:
14+
conda-win:
15+
runs-on: windows-2019
16+
defaults:
17+
run:
18+
shell: powershell
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
path: workspace/src/trajopt
23+
- name: install-depends
24+
shell: cmd
25+
run: |
26+
python -m pip install vcstool -q
27+
- name: vcs import
28+
run: >
29+
vcs import --input "${{ github.workspace }}/workspace/src/trajopt/.github/workflows/windows_dependencies.repos" workspace/src/
30+
- uses: conda-incubator/setup-miniconda@v3
31+
with:
32+
channel-priority: strict
33+
environment-file: workspace/src/trajopt/.github/workflows/conda/environment.yml
34+
use-mamba: true
35+
auto-update-conda: true
36+
activate-environment: tesseract-build
37+
- name: build and test
38+
run: |
39+
conda info
40+
conda list
41+
mkdir conda
42+
xcopy /E workspace\src\trajopt\.github\workflows\conda conda
43+
cd conda
44+
New-Item -Name conda-forge.yml -ItemType File
45+
conda smithy regenerate
46+
47+
conda mambabuild -m .ci_support/win_64_.yaml .
48+
49+
conda-linux:
50+
runs-on: ubuntu-latest
51+
defaults:
52+
run:
53+
shell: bash -el {0}
54+
steps:
55+
- uses: actions/checkout@v3
56+
with:
57+
path: workspace/src/trajopt
58+
- name: install-depends
59+
run: |
60+
python -m pip install vcstool -q
61+
- name: vcs import
62+
run: >
63+
vcs import --input "${{ github.workspace }}/workspace/src/trajopt/.github/workflows/windows_dependencies.repos" workspace/src/
64+
- uses: conda-incubator/setup-miniconda@v3
65+
with:
66+
channel-priority: strict
67+
environment-file: workspace/src/trajopt/.github/workflows/conda/environment.yml
68+
use-mamba: true
69+
auto-update-conda: true
70+
activate-environment: tesseract-build
71+
- name: build and test
72+
run: |
73+
conda info
74+
conda list
75+
76+
cp -r workspace/src/trajopt/.github/workflows/conda ./conda
77+
cd conda
78+
touch conda-forge.yml
79+
conda smithy regenerate
80+
81+
conda mambabuild -m .ci_support/linux_64_.yaml .
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: tesseract-build
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- boa
6+
- conda-smithy
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@if not defined CONDA_PREFIX goto:eof
2+
3+
@call "%CONDA_PREFIX%\opt\tesseract_robotics\setup.bat"
4+
5+
@set TESSERACT_PYTHON_DLL_PATH=%CONDA_PREFIX%\opt\tesseract_robotics\bin
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source "${CONDA_PREFIX}/opt/tesseract_robotics/setup.sh"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
set CXXFLAGS=%CXXFLAGS% -DEIGEN_DONT_ALIGN=1 -DEIGEN_DONT_VECTORIZE=1
2+
set CXXFLAGS=%CXXFLAGS% /std:c++17
3+
4+
colcon build --merge-install --install-base="%PREFIX%\opt\tesseract_robotics" ^
5+
--event-handlers console_cohesion+ desktop_notification- status- terminal_title- ^
6+
--packages-ignore gtest osqp osqp_eigen tesseract_examples trajopt_ifopt trajopt_sqp ^
7+
--cmake-args -GNinja -DCMAKE_BUILD_TYPE=Release ^
8+
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="/MD /O2 /Ob0 /Zi /DNDEBUG" ^
9+
-DCMAKE_RELWITHDEBINFO_POSTFIX="" ^
10+
-DBUILD_SHARED_LIBS=ON ^
11+
-DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON ^
12+
-DBUILD_IPOPT=OFF ^
13+
-DBUILD_SNOPT=OFF ^
14+
-DCMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^
15+
-DTESSERACT_ENABLE_CLANG_TIDY=OFF ^
16+
-DTESSERACT_ENABLE_CODE_COVERAGE=OFF ^
17+
-DPYTHON_EXECUTABLE="%PREFIX%\python.exe" ^
18+
-DTESSERACT_ENABLE_EXAMPLES=OFF ^
19+
-DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF ^
20+
-DTESSERACT_ENABLE_TESTING=OFF ^
21+
-DTRAJOPT_ENABLE_TESTING=ON
22+
23+
if %errorlevel% neq 0 exit /b %errorlevel%
24+
25+
set TESSERACT_RESOURCE_PATH=%PREFIX%\opt\tesseract_robotics\share
26+
27+
colcon test --event-handlers console_direct+ desktop_notification- status- terminal_title- ^
28+
--return-code-on-test-failure ^
29+
--packages-ignore gtest osqp osqp_eigen tesseract_examples trajopt_ifopt trajopt_sqp tesseract_common ^
30+
tesseract_collision tesseract_environment tesseract_geometry tesseract_kinematics tesseract_scene_graph ^
31+
tesseract_srdf tesseract_state_solver tesseract_support tesseract_urdf tesseract_visualization ^
32+
--merge-install --install-base="%PREFIX%\opt\tesseract_robotics"
33+
34+
if %errorlevel% neq 0 exit /b %errorlevel%
35+
36+
setlocal EnableDelayedExpansion
37+
38+
:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d.
39+
:: This will allow them to be run on environment activation.
40+
for %%F in (activate deactivate) DO (
41+
if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d
42+
copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat
43+
)
44+
45+
if %errorlevel% neq 0 exit /b %errorlevel%
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
set -e
2+
3+
ln -s $BUILD_PREFIX/bin/x86_64-conda-linux-gnu-gcc $BUILD_PREFIX/bin/gcc
4+
5+
colcon build --merge-install --install-base="$PREFIX/opt/tesseract_robotics" \
6+
--event-handlers console_cohesion+ \
7+
--packages-ignore gtest osqp osqp_eigen tesseract_examples trajopt_ifopt trajopt_sqp \
8+
--cmake-args -DCMAKE_BUILD_TYPE=Release \
9+
-DBUILD_SHARED_LIBS=ON \
10+
-DBUILD_IPOPT=OFF \
11+
-DBUILD_SNOPT=OFF \
12+
-DCMAKE_PREFIX_PATH:PATH="$PREFIX" \
13+
-DTESSERACT_ENABLE_CLANG_TIDY=OFF \
14+
-DTESSERACT_ENABLE_CODE_COVERAGE=OFF \
15+
-DTESSERACT_ENABLE_EXAMPLES=OFF \
16+
-DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF \
17+
-DSETUPTOOLS_DEB_LAYOUT=OFF \
18+
-DTESSERACT_ENABLE_TESTING=ON \
19+
-DTRAJOPT_ENABLE_TESTING=ON
20+
21+
export TESSERACT_RESOURCE_PATH="$PREFIX/opt/tesseract_robotics/share"
22+
23+
colcon test --event-handlers console_direct+ \
24+
--return-code-on-test-failure \
25+
--packages-ignore gtest osqp osqp_eigen tesseract_examples trajopt_ifopt trajopt_sqp tesseract_common \
26+
--merge-install --install-base="$PREFIX/opt/tesseract_robotics"
27+
28+
29+
for CHANGE in "activate" "deactivate"
30+
do
31+
mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d"
32+
cp "${RECIPE_DIR}/${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh"
33+
done

.github/workflows/conda/recipe/deactivate.bat

Whitespace-only changes.

.github/workflows/conda/recipe/deactivate.sh

Whitespace-only changes.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
package:
2+
name: trajopt
3+
version: "0.1.0"
4+
5+
source:
6+
path: ../../workspace
7+
8+
requirements:
9+
build:
10+
- {{ compiler('c') }}
11+
- {{ compiler('cxx') }}
12+
- gtest
13+
- gmock
14+
- cmake
15+
- ninja # [win]
16+
- make # [linux]
17+
- pkg-config
18+
- colcon-common-extensions
19+
- lcov
20+
- {{ cdt('mesa-libgl-devel') }} # [linux]
21+
- {{ cdt('mesa-dri-drivers') }} # [linux]
22+
- git
23+
host:
24+
- boost-cpp
25+
- eigen
26+
- tinyxml2
27+
- console_bridge
28+
- assimp
29+
- urdfdom
30+
- fcl
31+
- octomap
32+
- orocos-kdl
33+
- pcl
34+
- gtest
35+
- gmock
36+
- pkg-config
37+
- xz
38+
- flann
39+
- jsoncpp
40+
- yaml-cpp
41+
- bullet-cpp
42+
- xorg-libx11 # [unix]
43+
- xorg-libxext # [unix]
44+
- blas
45+
- osqp
46+
- qpoases
47+
run:
48+
- boost-cpp
49+
- eigen
50+
- tinyxml2
51+
- console_bridge
52+
- assimp
53+
- urdfdom
54+
- fcl
55+
- octomap
56+
- orocos-kdl
57+
- pcl
58+
- gtest
59+
- gmock
60+
- xz
61+
- jsoncpp
62+
- taskflow
63+
- yaml-cpp
64+
- bullet-cpp
65+
- xorg-libx11 # [unix]
66+
- xorg-libxext # [unix]
67+
- blas
68+
- osqp
69+
- qpoases
70+
71+
build:
72+
skip: true # [py<37]
73+
number: 0
74+
75+
about:
76+
home: https://github.com/ros-industrial-consortium/trajopt
77+
summary: Trajopt motion planner

trajopt/test/benchmarks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ macro(add_benchmark benchmark_name benchmark_file)
1010
target_link_libraries(
1111
${benchmark_name}
1212
${PROJECT_NAME}
13-
osqp::osqpstatic
13+
osqp::osqp
1414
benchmark::benchmark)
1515
target_include_directories(${benchmark_name} PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
1616
add_dependencies(${benchmark_name} ${PROJECT_NAME})

0 commit comments

Comments
 (0)