diff --git a/.github/workflows/pixi.yaml b/.github/workflows/pixi.yaml new file mode 100644 index 000000000..d238ef74c --- /dev/null +++ b/.github/workflows/pixi.yaml @@ -0,0 +1,64 @@ +name: Pixi (conda) + +on: [push, pull_request] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + # Note if this value is changed, has to be manually updated in the `windows-latest` tests_command + BUILD_TYPE: Release + +jobs: + pixi_conda_build: + strategy: + matrix: + include: + - os: windows-latest + shell: "pwsh -Login {0}" + pixi_install: "iwr -useb https://pixi.sh/install.ps1 | iex" + build_depend: vs2022_win-64=19.* + tests_command: "'PATH=\\\"$PATH;build/Release\\\" build/tests/Release/behaviortree_cpp_test.exe'" + - os: ubuntu-latest + shell: "bash -el {0}" + pixi_install: "curl -fsSL https://pixi.sh/install.sh | bash" + build_depend: "gxx=12.2.*" + tests_command: "./build/tests/behaviortree_cpp_test" + runs-on: ${{ matrix.os }} + defaults: + run: + shell: ${{ matrix.shell }} + steps: + # Pixi is the tool used to create/manage conda environment + - name: Set up pixi + run: | + ${{ matrix.pixi_install }} + - name: Setup windows path + if: "startsWith(runner.os, 'windows')" + run: echo "C:\Users\runneradmin\AppData\Local\pixi\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + - name: Make pixi workspace + run: | + pixi init build-env + - name: Install dependencies + working-directory: ${{github.workspace}}/build-env + run: | + pixi add cmake zeromq=4.3.4 gtest=1.12.* gmock=1.12.* sqlite=3.40.* ${{ matrix.build-depend }} + pixi install + - name: Create Build Directory + working-directory: ${{github.workspace}}/build-env + run: mkdir build + - uses: actions/checkout@v3 + with: + path: build-env/BehaviorTree.CPP + - name: Build + working-directory: ${{github.workspace}}/build-env + run: | + pixi task add build "cd build; cmake ../BehaviorTree.CPP -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}; cmake --build . --parallel --config ${{env.BUILD_TYPE}}" + pixi run build + - name: Run tests + working-directory: ${{github.workspace}}/build-env + run: | + pixi task add tests ${{ matrix.tests_command }} + pixi run tests + + + + \ No newline at end of file diff --git a/3rdparty/minitrace/minitrace.cpp b/3rdparty/minitrace/minitrace.cpp index 86d2e24a5..6abf4e6d0 100644 --- a/3rdparty/minitrace/minitrace.cpp +++ b/3rdparty/minitrace/minitrace.cpp @@ -27,6 +27,9 @@ #include #endif +#define __STDC_FORMAT_MACROS +#include + #include "minitrace.h" #ifdef __GNUC__ diff --git a/cmake/FindZeroMQ.cmake b/cmake/FindZeroMQ.cmake index 3f20271a0..8553df95c 100644 --- a/cmake/FindZeroMQ.cmake +++ b/cmake/FindZeroMQ.cmake @@ -29,6 +29,8 @@ else (ZeroMQ_LIBRARIES AND ZeroMQ_INCLUDE_DIRS) find_path(ZeroMQ_INCLUDE_DIR NAMES zmq.h + HINTS + "$ENV{CONDA_PREFIX}/include" PATHS /usr/include /usr/local/include @@ -38,6 +40,7 @@ else (ZeroMQ_LIBRARIES AND ZeroMQ_INCLUDE_DIRS) find_library(ZeroMQ_LIBRARY NAMES zmq + libzmq PATHS /usr/lib /usr/local/lib diff --git a/cmake/conan_build.cmake b/cmake/conan_build.cmake index b824487dd..3bf3a7225 100644 --- a/cmake/conan_build.cmake +++ b/cmake/conan_build.cmake @@ -3,6 +3,7 @@ list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}") if(BTCPP_GROOT_INTERFACE) find_package(ZeroMQ REQUIRED) list(APPEND BTCPP_EXTRA_LIBRARIES ${ZeroMQ_LIBRARIES}) + list(APPEND BTCPP_EXTRA_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIRS}) message(STATUS "ZeroMQ_LIBRARIES: ${ZeroMQ_LIBRARIES}") endif()