Skip to content

Commit

Permalink
Fix/pixi build (BehaviorTree#791)
Browse files Browse the repository at this point in the history
* wip: create pixi toml

* fix: Fixes windows test command and strips out pixi workflow to just work with toml

* docs: update readme with pixi build instructions and CI badge

* ci: fix order to first checkout then setup pixi

* fix: pixi linux-64 build works on WSL

* misc: add pre-commit and run it

---------

Co-authored-by: Davide Faconti <davide.faconti@gmail.com>
  • Loading branch information
tony-p and facontidavide authored Apr 2, 2024
1 parent 5d7965a commit 2d0608a
Show file tree
Hide file tree
Showing 6 changed files with 1,737 additions and 39 deletions.
46 changes: 7 additions & 39 deletions .github/workflows/pixi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,21 @@ 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
build_depend: vs2022_win-64=19.*
tests_command: "'PATH=\\\"$PATH;build/Release\\\" build/tests/Release/behaviortree_cpp_test.exe'"
- os: ubuntu-latest
build_depend: "gxx=12.2.*"
tests_command: "./build/tests/behaviortree_cpp_test"
os:
- windows-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
# Pixi is the tool used to create/manage conda environment
- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.7.0
locked: false
frozen: false
run-install: false
manifest-path: build-env/pixi.yaml
- 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
- uses: prefix-dev/setup-pixi@v0.4.1
with:
path: build-env/BehaviorTree.CPP
pixi-version: v0.16.1
- 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
run: pixi run build
- name: Run tests
working-directory: ${{github.workspace}}/build-env
run: |
pixi task add tests ${{ matrix.tests_command }}
pixi run tests
run: pixi run test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ CMakeSettings.json

# OSX junk
.DS_Store

# pixi environments
.pixi

CMakeUserPresets.json
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ target_link_libraries(${BTCPP_LIBRARY}
Threads::Threads
${CMAKE_DL_LIBS}
$<BUILD_INTERFACE:foonathan::lexy>
PUBLIC
${BTCPP_EXTRA_LIBRARIES}
)

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![conan Windows](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/cmake_windows.yml/badge.svg)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/cmake_windows.yml)
[![ros1](https://github.com/BehaviorTree/BehaviorTree.CPP/workflows/ros1/badge.svg?branch=master)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions?query=workflow%3Aros1)
[![ros2](https://github.com/BehaviorTree/BehaviorTree.CPP/workflows/ros2/badge.svg?branch=master)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions?query=workflow%3Aros2)
[![pixi (Conda)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/pixi.yaml/badge.svg)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/pixi.yaml)

# BehaviorTree.CPP 4.5

Expand Down Expand Up @@ -87,6 +88,11 @@ cmake ../BehaviorTree.CPP
cmake --build . --parallel
```

If you want to build in a [pixi](https://pixi.sh/) project (conda virtual environment).
```
pixi run build
```

If you want to use BT.CPP in your application, please refer to the
example here: https://github.com/BehaviorTree/btcpp_sample .

Expand Down
Loading

0 comments on commit 2d0608a

Please sign in to comment.