Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
0c9fe42
Make tick method protected
redvinaa Jul 31, 2025
7fc24c5
Propagate node config to parent
redvinaa Jul 31, 2025
2e8b13e
Lint
redvinaa Jul 31, 2025
6731c51
fix: check path attribute before using (#1005)
ahuo1 Sep 10, 2025
4b23dca
fix: validate __type field before accessing in fromJson (#1009)
ahuo1 Sep 11, 2025
cb6c751
fix: use dynamically growing error buffer in ParseScript (#1007)
ahuo1 Sep 11, 2025
8750370
Append SQLite3_INCLUDE_DIRS to BTCPP_EXTRA_INCLUDE_DIRS, otherwise sq…
sprkrd Sep 11, 2025
2ed6d49
Clean up VerifyXML logic (#1000)
EzraBrooks Sep 11, 2025
58ed0ec
remove wildcards from 3rd party
facontidavide Sep 30, 2025
3ea38fc
update cppzmq to 4.11.0
facontidavide Sep 30, 2025
e2e3dbc
formatting
facontidavide Sep 30, 2025
624b11b
remove cpp-sqlite
facontidavide Sep 30, 2025
b6761f5
changelog updated
facontidavide Sep 30, 2025
9b3e791
4.7.3
facontidavide Sep 30, 2025
8ce8b8e
compile for c++ 17 (#1013)
facontidavide Sep 30, 2025
d8c1609
fix potential compilation errors
facontidavide Sep 30, 2025
c0bc00b
update tinyxml to version 11.0
facontidavide Oct 6, 2025
c381486
Improve handling of dependencies (#1012)
ericriff Oct 6, 2025
bd1dd25
Remove unused conan.cmake (#1016)
ericriff Oct 6, 2025
1ed4f04
Add support for sanitizers including some GHAs
ericriff Oct 6, 2025
92feada
use gtest_discover_tests to regiester the unit tests
ericriff Oct 7, 2025
2523528
Combine sanitizer actions into a single file
ericriff Oct 7, 2025
1b989f3
Do not fail fast. We want results of both sanitizer runs
ericriff Oct 7, 2025
390b99b
Fix windows builds
ericriff Oct 7, 2025
d6221b0
Leave a note for posterity
ericriff Oct 7, 2025
24f3d93
Improve error message
ericriff Oct 7, 2025
6f16449
s/ncurses.h/curses.h/ (#1020)
lalten Oct 9, 2025
3d7e1e1
fix thread safety issues
facontidavide Oct 14, 2025
06c856a
fix memory leak
facontidavide Oct 14, 2025
831cadd
fix issue in destruction order
facontidavide Oct 14, 2025
18a5391
Merge pull request #1022 from BehaviorTree/thread_sanitizer
facontidavide Oct 14, 2025
730bb65
prepare release
facontidavide Oct 14, 2025
22929a2
4.8.0
facontidavide Oct 14, 2025
7a88482
fix warning
facontidavide Oct 23, 2025
3580210
fix private pedendencies
facontidavide Oct 23, 2025
042875f
stop installing lexy
facontidavide Oct 23, 2025
4dcef6c
Merge pull request #1027 from BehaviorTree/fix_private_deps
facontidavide Oct 23, 2025
2b4dc5b
prepare release
facontidavide Oct 23, 2025
36d13ed
4.8.1
facontidavide Oct 23, 2025
b8a62dd
added Tree::emitWakeUpSignal
pleemann Oct 23, 2025
b451618
force tinyxml2_vendor in ROS2. See #1033 and #1028
facontidavide Oct 30, 2025
08605d1
Merge pull request #1030 from pleemann/tree_wake_up
facontidavide Oct 30, 2025
5a586c8
fix issue #1034
facontidavide Oct 30, 2025
bae824a
Merge branch 'master' of github.com:BehaviorTree/BehaviorTree.CPP
facontidavide Oct 30, 2025
ddc8247
Merge pull request #996 from EnjoyRobotics/make-sequence-node-inherit…
facontidavide Oct 30, 2025
6b7129a
Merge branch 'master' of github.com:BehaviorTree/BehaviorTree.CPP
facontidavide Oct 30, 2025
425bd39
prepare release
facontidavide Oct 30, 2025
aa24260
4.8.2
facontidavide Oct 30, 2025
8d3dbb3
Update copyright year in README.md
facontidavide Oct 30, 2025
cdaca9c
Restore Star History and add Contributors section
facontidavide Oct 30, 2025
78b159d
Turn cppzmq dependency public
uilianries Dec 15, 2025
4afefac
Merge pull request #1043 from uilianries/fix/cppzmq-visibility
facontidavide Dec 24, 2025
15658a7
fix multiple issues with SimpleString
facontidavide Dec 29, 2025
01d504c
add unit test
facontidavide Dec 29, 2025
381612b
update copyright year
facontidavide Dec 29, 2025
61592fe
move and clan up tests
facontidavide Dec 29, 2025
fe02e79
Add Clang tidy and many fixes (#1047)
facontidavide Dec 29, 2025
8aaddc8
Bump codecov/codecov-action from 3 to 5 (#1048)
dependabot[bot] Dec 29, 2025
9bc29a8
Bump prefix-dev/setup-pixi from 0.8.1 to 0.9.3 (#1049)
dependabot[bot] Dec 29, 2025
4ed7ef7
Bump actions/setup-python from 5 to 6 (#1051)
dependabot[bot] Dec 29, 2025
ff0830a
Bump actions/checkout from 2 to 6 (#1050)
dependabot[bot] Dec 29, 2025
871848f
release 4.8.3
facontidavide Dec 30, 2025
6e469c6
fix pixi CI
facontidavide Dec 30, 2025
5f51577
add contributors guide
facontidavide Dec 30, 2025
94bb396
Merge branch 'port_tests'
facontidavide Dec 30, 2025
93f0f1a
cleanup doc
facontidavide Dec 30, 2025
3e8c292
Fullpath fix (#1053)
facontidavide Jan 9, 2026
8f86eb9
add new name validation rules
facontidavide Jan 9, 2026
468bb63
sort includes with clang format
facontidavide Jan 9, 2026
88248a1
cleanup and fix validation
facontidavide Jan 9, 2026
e8118fd
add some documentation to classes
facontidavide Jan 9, 2026
f007549
comments
facontidavide Jan 9, 2026
1f9389d
add tool to generate XML models
facontidavide Jan 9, 2026
f281703
extend the Groot example to reproduce issues with arrays
facontidavide Jan 9, 2026
817db5b
prepare release
facontidavide Jan 9, 2026
09c0857
4.8.4
facontidavide Jan 9, 2026
cb75426
fix compilation
facontidavide Jan 9, 2026
ded9027
fix implicit-bool-conversion warning in xml_parsing.cpp
facontidavide Jan 9, 2026
8b79f96
Update API documentation link in README
facontidavide Jan 15, 2026
b3dbe30
Generate .clangd in PROJECT_SOURCE_DIR (#1059)
nyibbang Jan 19, 2026
51df1e0
Fix #1029: correct left-associativity for arithmetic operators in scr…
facontidavide Feb 1, 2026
c36bd4d
Fix #969: LoopNode accepts std::vector<T> in addition to SharedQueue<…
facontidavide Feb 1, 2026
8c784dd
Fix #408: debugMessage shows type info for remapped subtree entries (…
facontidavide Feb 1, 2026
223b3ed
Fix #982: handle json: prefix in vector convertFromString specializat…
facontidavide Feb 1, 2026
d2ee3cf
Fix #948: parseString supports enums with convertFromString specializ…
facontidavide Feb 1, 2026
3bc04cf
Add regression test for #923: ValidateScript OOB read with large inva…
facontidavide Feb 1, 2026
b0143f4
Add regression test for #832: script compare with negative number (#1…
facontidavide Feb 1, 2026
2c9d9d7
Add regression test for #858: getInput with default port value (#1076)
facontidavide Feb 1, 2026
fd40532
Bump prefix-dev/setup-pixi from 0.9.3 to 0.9.4 (#1066)
dependabot[bot] Feb 1, 2026
2d81a59
Add regression test for #1065: subtree string literal to LoopDouble (…
facontidavide Feb 1, 2026
e0e6def
Remove use of `std::aligned_storage` (#1061)
nyibbang Feb 1, 2026
c6393f7
Fixed possible infinite loop in Groot2Publisher when destructor is ca…
alvintps Feb 1, 2026
1571da2
Add code coverage job with Codecov upload and workflow_dispatch trigg…
facontidavide Feb 1, 2026
53040fa
Fix #942: getLockedPortContent creates entry for default-remapped por…
facontidavide Feb 1, 2026
e0684b0
Add vcpkg installation instructions (#421)
FrankXie05 Feb 1, 2026
1217c7e
Fix #937: enable returning BehaviorTreeFactory by value (#1082)
facontidavide Feb 1, 2026
25407ad
Fix #934: segfault when substituting a SubTree node (#1083)
facontidavide Feb 1, 2026
d53a8ea
Fix #1046: use-after-free when factory destroyed before tree (#1081)
facontidavide Feb 1, 2026
5060cd4
Fix #930: mock substitution hangs when TestNodeConfigs absent (#1084)
facontidavide Feb 1, 2026
0125875
Detect recursive subtree cycles at parse time (fixes #979) (#1085)
facontidavide Feb 1, 2026
9f30be1
Fix #930: mock substitution hangs when TestNodeConfigs is absent (#1086)
facontidavide Feb 1, 2026
2e72fb3
Restrict coverage report to include/ and src/ directories only
facontidavide Feb 1, 2026
f9a6f98
Fix #672: detect and reject deeply-nested/recursive XML to prevent st…
facontidavide Feb 2, 2026
e1ed3a1
Fix #989: JsonExporter use-after-move in vector converter registratio…
facontidavide Feb 2, 2026
41d8f70
Restrict coverage to include/ and src/ directories only
facontidavide Feb 2, 2026
b947663
Exclude contrib/ vendored headers from coverage
facontidavide Feb 2, 2026
e2460ae
Fix flaky Parallel.PauseWithRetry test on CI
facontidavide Feb 2, 2026
a590e6a
Add Debug build to Windows CI matrix
facontidavide Feb 2, 2026
46fe516
Fix Windows build issues (#762, #869, #836) (#1089)
facontidavide Feb 2, 2026
4551d2a
Fix Codecov UI showing files outside include/ and src/
facontidavide Feb 2, 2026
deae944
Fix coverage CI: add Coveralls, Codacy, SonarCloud alongside Codecov
facontidavide Feb 2, 2026
0d7464c
Fix: DelayNode ignores delay_msec when created from XML (#1097)
Copilot Feb 2, 2026
8c18a27
Merge branch 'master' of github.com:BehaviorTree/BehaviorTree.CPP
facontidavide Feb 2, 2026
2c71b41
Fix misleading static_assert when extra args have wrong type (#837) (…
facontidavide Feb 2, 2026
fcb95c8
Fix Groot2Publisher destructor infinite loop (#1057) (#1100)
facontidavide Feb 3, 2026
e72efbf
coments about precondition added. fix #917
facontidavide Feb 3, 2026
80cc070
add gitignore
facontidavide Feb 3, 2026
38dd4cf
Merge branch 'master' of github.com:BehaviorTree/BehaviorTree.CPP
facontidavide Feb 3, 2026
2626fc5
Replace codecov badge with coverage status badge
facontidavide Feb 3, 2026
061fd8e
Improve test suite quality and coverage (#1102)
facontidavide Feb 4, 2026
2fb34b5
Fix #953: getInput() now uses stored converter for plugin custom type…
facontidavide Feb 4, 2026
1792196
Add Doxygen welcome page with organized navigation
facontidavide Feb 4, 2026
d198332
Remove lexy dependency, replace with hand-written tokenizer and Pratt…
facontidavide Feb 4, 2026
c8f92dc
improved doxygen
facontidavide Feb 4, 2026
f4eed9c
Update README.md
facontidavide Feb 4, 2026
96ceaea
improve doxygen page
facontidavide Feb 4, 2026
e153541
Merge branch 'master' of github.com:BehaviorTree/BehaviorTree.CPP
facontidavide Feb 4, 2026
1716a60
Fix #880: createTreeFromText now finds previously registered subtrees
facontidavide Feb 4, 2026
4cfc7d0
Merge pull request #1105 from BehaviorTree/fix/880-subtree-from-text
facontidavide Feb 4, 2026
417b3e4
Fix missing read_parameter_from_ports_ initialization in DelayNode (#…
facontidavide Feb 4, 2026
66a60fa
Merge branch 'master' of github.com:BehaviorTree/BehaviorTree.CPP
facontidavide Feb 4, 2026
83c36a4
Remove redundant default member initializer from DelayNode
facontidavide Feb 4, 2026
b9bc25c
fix issue #861
facontidavide Feb 4, 2026
664d4b2
Add exception tracking with node backtrace (fixes #990) (#1106)
facontidavide Feb 4, 2026
c7c0ea7
Add clang-tidy pre-commit hook and fix clang-tidy warnings
facontidavide Feb 4, 2026
1da6d64
Add test for Issue #819: Sequence vs ReactiveSequence behavior
facontidavide Feb 4, 2026
d6d1345
Merge pull request #1108 from BehaviorTree/test/issue-819-sequence-vs…
facontidavide Feb 4, 2026
facf5a0
Add concurrency to CI workflows to cancel in-progress jobs
facontidavide Feb 4, 2026
ffab835
Fix clang-tidy warnings across tests, examples, and samples (#1109)
facontidavide Feb 5, 2026
f1c2b8e
Using unguarded `std::from_chars` breaks compilation on older g++ ver…
chhtz Feb 5, 2026
1e166f5
Add polymorphic shared_ptr port support (Issue #943) (#1107)
facontidavide Feb 5, 2026
fee8964
Fix EntryUpdatedDecorator::halt() not halting its child (#1112)
facontidavide Feb 5, 2026
b8f2715
Add TryCatch control node
facontidavide Feb 8, 2026
a557f3c
Fix XML parser null pointer and variable shadowing in loadSubtreeModel
facontidavide Feb 8, 2026
519917d
Fix Blackboard thread-safety data races
facontidavide Feb 8, 2026
af79e4f
Use shared_mutex for Blackboard storage and remove deprecated entryMutex
facontidavide Feb 8, 2026
3633e27
Merge pull request #1116 from BehaviorTree/bug_fixes_auto
facontidavide Feb 9, 2026
a3ce94f
minor changes
facontidavide Feb 11, 2026
5504c86
prepare release
facontidavide Feb 11, 2026
3ff6a32
4.9.0
facontidavide Feb 11, 2026
9317db5
Update `setOutput<T>` to convert vectors to `vector<Any>` and `getInp…
dyackzan Dec 17, 2024
6143bec
Add type & value fields to primitive json types (#5)
dyackzan Jan 30, 2025
97fa205
A better JSON serialization for non-registered types
pac48 Jun 24, 2025
1183b50
fix(loop): accept vector<Any> queues from the fork's setOutput
dv-picknik Aug 4, 2026
b1f0e74
18029 Fix misleading error message for unrecognized behavior ports
griswaldbrooks Apr 9, 2026
5146442
Allow for strongly typed numbers to be added with non-strongly typed …
Apr 27, 2026
11d3fd4
fix: add port errors surfaced for deterministic error type checking
shaur-k Apr 24, 2026
2f11f0e
Fix subtree ports, with auto_remapped appended for ABI compatibility
dv-picknik Aug 4, 2026
7b48a28
Allow for vector to string conversions
dv-picknik Aug 4, 2026
0c84c25
feat: package as behaviortree_cpp_picknik with versioned soname
dv-picknik Aug 4, 2026
fbed232
tests: prove VerifyXML line numbers are correct through nesting
dv-picknik Aug 4, 2026
e89db2b
fix(xml): permit spaces in model names
dv-picknik Aug 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 16 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,22 @@ SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
ContinuationIndentWidth: 4
SortIncludes: false
SortIncludes: CaseSensitive
IncludeBlocks: Regroup
IncludeCategories:
# Main header (same name as source file)
- Regex: '^"[^/]*\.h(pp)?"$'
Priority: 1
# BehaviorTree.CPP project headers
- Regex: '^"behaviortree_cpp/.*'
Priority: 2
# C++ standard library headers
- Regex: '^<[a-z_]+>$'
Priority: 3
# System headers with .h extension
- Regex: '^<.*\.h>'
Priority: 4
IncludeIsMainRegex: '(_test)?$'
SpaceAfterCStyleCast: false
ReflowComments: false

Expand Down
48 changes: 48 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Checks: [
"-*",
"bugprone-*",
"cert-*",
"clang-analyzer-*",
"concurrency-*",
"cppcoreguidelines-*",
"misc-*",
"modernize-*",
"performance-*",
"portability-*",
"readability-*",
"-bugprone-easily-swappable-parameters",
"-bugprone-narrowing-conversions",
"-cert-err58-cpp",
"-cppcoreguidelines-avoid-c-arrays",
"-cppcoreguidelines-avoid-magic-numbers",
"-cppcoreguidelines-avoid-non-const-global-variables",
"-cppcoreguidelines-non-private-member-variables-in-classes",
"-cppcoreguidelines-pro-bounds-array-to-pointer-decay",
"-cppcoreguidelines-pro-bounds-constant-array-index",
"-cppcoreguidelines-pro-bounds-pointer-arithmetic",
"-cppcoreguidelines-pro-type-const-cast",
"-cppcoreguidelines-pro-type-union-access",
"-cppcoreguidelines-pro-type-vararg",
"-misc-no-recursion",
"-misc-non-private-member-variables-in-classes"
]


WarningsAsErrors: '-*,bugprone-*,cert-*,clang-analyzer-*,concurrency-*,cppcoreguidelines-*,misc-*,portability-*,readability-implicit-bool-conversion,-concurrency-mt-unsafe,-readability-function-cognitive-complexity'

CheckOptions:
# ignore macros when computing the cyclomatic complexity. problem caused by RCLCPP LOG macros
- key: readability-function-cognitive-complexity.IgnoreMacros
value: 'true'

# This change makes it compatible with MISRA:2023 rule 4.14.1
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: 'true'

# Making a copy of a shared_ptr has a non-zero cost, but this cost is small.
# Unfortunately the ROS API (subscriber callbacks) oblige the user to use callbacks functions that will trigger this warning
# This is the reason wht the warning is silenced here
- key: performance-unnecessary-value-param.AllowedTypes
value: 'std::shared_ptr'

# Reference: https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-naming.html
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
14 changes: 7 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!--
You must run clang-format, otherwise your change may not pass the tests on CI
We recommend using pre-commit.
## Instructions

To use:
pre-commit run -a
Or:
pre-commit install # (runs every time you commit in git)
- Unless your code is self explaining, add comments.
- Consider if your proposed changes introduces API, ABI, back-compatibility or behavioral changes.
- If your code is fixing a bug, please create a unit test to reproduce the bug, i.e. a test that fails before the fix and pass after the fix.
- You use [pre-commit](https://pre-commit.com/) to apply automatically all the required linting rules (clang-format in particular).
- You should also execute the script `./run_clang_tidy.sh` and correct all the warnings.

See https://github.com/pre-commit/pre-commit
Please read the CONTRIBUTORS_GUIDE.md file for details and instructions.
-->
117 changes: 96 additions & 21 deletions .github/workflows/cmake_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ on:
- master
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6

- name: Install Conan
id: conan
Expand All @@ -32,28 +32,103 @@ jobs:
- name: Create default profile
run: conan profile detect

- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build

- name: Install conan dependencies
working-directory: ${{github.workspace}}/build
run: conan install ${{github.workspace}}/conanfile.txt -s build_type=${{env.BUILD_TYPE}} --build=missing
run: conan install conanfile.py -s build_type=${{env.BUILD_TYPE}} --build=missing

- name: Normalize build type
shell: bash
run: echo "BUILD_TYPE_LOWERCASE=$(echo "${BUILD_TYPE}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
run: cmake --preset conan-${{ env.BUILD_TYPE_LOWERCASE }}

- name: Build
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake --build . --config ${{env.BUILD_TYPE}}
run: cmake --build --preset conan-${{ env.BUILD_TYPE_LOWERCASE }}

- name: run test (Linux)
working-directory: ${{github.workspace}}/build/tests
run: ctest
run: ctest --test-dir build/${{env.BUILD_TYPE}}

coverage:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Full history needed by SonarCloud

- name: Install lcov
run: sudo apt-get update && sudo apt-get install -y lcov

- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main

- name: Create default profile
run: conan profile detect

- name: Install conan dependencies
run: conan install conanfile.py -s build_type=Debug --build=missing

- name: Configure CMake with coverage
shell: bash
run: |
cmake --preset conan-debug \
-DCMAKE_C_FLAGS="--coverage -fprofile-update=atomic" \
-DCMAKE_CXX_FLAGS="--coverage -fprofile-update=atomic"

- name: Build
shell: bash
run: cmake --build --preset conan-debug

- name: Run tests
run: ctest --test-dir build/Debug --output-on-failure

- name: Collect coverage
run: |
lcov --capture --directory build/Debug \
--output-file coverage.info \
--ignore-errors mismatch,mismatch \
--ignore-errors negative,negative \
--ignore-errors gcov,gcov
lcov --extract coverage.info \
'*/BehaviorTree.CPP/include/*' \
'*/BehaviorTree.CPP/src/*' \
--output-file coverage.info \
--ignore-errors unused
lcov --remove coverage.info \
'*/contrib/*' \
--output-file coverage.info \
--ignore-errors unused
lcov --list coverage.info

# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v5
# continue-on-error: true
# with:
# files: coverage.info
# flags: unittests
# disable_search: true
# disable_file_fixes: false
# plugins: noop
# network_filter: >-
# include/behaviortree_cpp/,src/
# token: ${{ secrets.CODECOV_TOKEN }}

# --- Coveralls ---
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: coverage.info
format: lcov
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
# --- SonarCloud ---
- name: Run SonarCloud analysis
uses: SonarSource/sonarcloud-github-action@v5
continue-on-error: true
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73 changes: 73 additions & 0 deletions .github/workflows/cmake_ubuntu_sanitizers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: cmake Ubuntu Sanitizers

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
sanitizer: [asan_ubsan, tsan]

steps:
- uses: actions/checkout@v6

- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main

- name: Create default profile
run: conan profile detect

- name: Install conan dependencies
run: conan install conanfile.py -s build_type=${{env.BUILD_TYPE}} --build=missing

- name: Normalize build type
shell: bash
# The build type is Capitalized, e.g. Release, but the preset is all lowercase, e.g. release.
# There is no built in way to do string manipulations on GHA as far as I know.`
run: echo "BUILD_TYPE_LOWERCASE=$(echo "${BUILD_TYPE}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Configure CMake
shell: bash
run: |
if [[ "${{ matrix.sanitizer }}" == "asan_ubsan" ]]; then
cmake --preset conan-${{ env.BUILD_TYPE_LOWERCASE }} \
-DBTCPP_ENABLE_ASAN:BOOL=ON -DBTCPP_ENABLE_UBSAN:BOOL=ON
else
cmake --preset conan-${{ env.BUILD_TYPE_LOWERCASE }} \
-DBTCPP_ENABLE_TSAN:BOOL=ON
fi

- name: Build
shell: bash
run: cmake --build --preset conan-${{ env.BUILD_TYPE_LOWERCASE }}

- name: run test (Linux + Address and Undefined Behavior Sanitizers)
env:
GTEST_COLOR: "On"
ASAN_OPTIONS: "color=always"
UBSAN_OPTIONS: "halt_on_error=1:print_stacktrace=1:color=always"
TSAN_OPTIONS: "suppressions=../../../tests/tsan_suppressions.txt:color=always"
# There is a known issue with TSAN on recent kernel versions. Without the vm.mmap_rnd_bits=28
# workaround all binaries with TSan enabled crash with "FATAL: ThreadSanitizer: unexpected memory mapping"
run: sudo sysctl vm.mmap_rnd_bits=28 && ctest --test-dir build/${{env.BUILD_TYPE}} --output-on-failure
37 changes: 15 additions & 22 deletions .github/workflows/cmake_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,20 @@ on:
pull_request:
types: [opened, synchronize, reopened]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
build_type: [Release, Debug]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Conan
id: conan
Expand All @@ -32,25 +29,21 @@ jobs:
- name: Create default profile
run: conan profile detect

- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build

- name: Install conan dependencies
working-directory: ${{github.workspace}}/build
run: conan install ${{github.workspace}}/conanfile.txt -s build_type=${{env.BUILD_TYPE}} --build=missing
run: conan install conanfile.py -s build_type=${{ matrix.build_type }} --build=missing --settings:host compiler.cppstd=17

- name: Normalize build type
shell: bash
run: echo "BUILD_TYPE_LOWERCASE=$(echo "${{ matrix.build_type }}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
run: cmake --preset conan-default

- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config ${{env.BUILD_TYPE}}
run: cmake --build --preset conan-${{ env.BUILD_TYPE_LOWERCASE }}

- name: run test (Windows)
working-directory: ${{github.workspace}}/build
run: $env:PATH+=";${{env.BUILD_TYPE}}"; tests/${{env.BUILD_TYPE}}/behaviortree_cpp_test.exe
- name: Run tests
working-directory: ${{ github.workspace }}/build
run: $env:PATH+=";${{ matrix.build_type }}"; tests/${{ matrix.build_type }}/behaviortree_cpp_test.exe
4 changes: 4 additions & 0 deletions .github/workflows/doxygen-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- main
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
Expand Down
Loading