Skip to content

Commit 415cee0

Browse files
committed
Initial commit
0 parents  commit 415cee0

17 files changed

+515
-0
lines changed

.clang-format-ignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
./include/optim
2+
*/xgboost_classifier.cpp

.github/workflows/build_master.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Build the package and run tests, using the latest trifinger_user Apptainer
2+
# image.
3+
# The Apptainer image has a full ROBOT_FINGERS workspace installed, so all
4+
# dependencies are there and only the checked package needs to be build, not the
5+
# whole workspace.
6+
#
7+
# Note: The Apptainer image only gets automatically rebuild, if something in the
8+
# image definition changes, not when other packages are changed. So to avoid
9+
# that the workspace in the container gets outdated, manual builds need to be
10+
# triggered regularly.
11+
12+
name: Build and Test
13+
14+
on:
15+
push:
16+
branches:
17+
- master
18+
19+
jobs:
20+
build_and_test:
21+
runs-on: ubuntu-20.04
22+
23+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
24+
permissions:
25+
pages: write # to deploy to Pages
26+
id-token: write # to verify the deployment originates from an appropriate source
27+
28+
# Deploy to the github-pages environment
29+
environment:
30+
name: github-pages
31+
url: ${{ steps.doc.outputs.page_url }}
32+
33+
steps:
34+
- name: Check out code
35+
uses: actions/checkout@v3
36+
37+
- name: Setup Apptainer
38+
uses: open-dynamic-robot-initiative/trifinger-build-action/setup_apptainer@v2
39+
40+
- name: Build
41+
uses: open-dynamic-robot-initiative/trifinger-build-action/build@v2
42+
43+
- name: Documentation
44+
id: doc
45+
uses: open-dynamic-robot-initiative/trifinger-build-action/build_and_deploy_docs@v2
46+
47+
- name: Tests
48+
uses: open-dynamic-robot-initiative/trifinger-build-action/run_tests@v2

.github/workflows/build_pr.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Build the package and run tests, using the latest trifinger_user Apptainer
2+
# image.
3+
# The Apptainer image has a full ROBOT_FINGERS workspace installed, so all
4+
# dependencies are there and only the checked package needs to be build, not the
5+
# whole workspace.
6+
#
7+
# Note: The Apptainer image only gets automatically rebuild, if something in the
8+
# image definition changes, not when other packages are changed. So to avoid
9+
# that the workspace in the container gets outdated, manual builds need to be
10+
# triggered regularly.
11+
12+
name: Build and Test
13+
14+
on: pull_request
15+
16+
jobs:
17+
build_and_test:
18+
runs-on: ubuntu-20.04
19+
steps:
20+
- name: Check out code
21+
uses: actions/checkout@v3
22+
23+
- name: Setup Apptainer
24+
uses: open-dynamic-robot-initiative/trifinger-build-action/setup_apptainer@v2
25+
26+
- name: Build
27+
uses: open-dynamic-robot-initiative/trifinger-build-action/build@v2
28+
29+
- name: Tests
30+
uses: open-dynamic-robot-initiative/trifinger-build-action/run_tests@v2

.github/workflows/git_fixup.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Git Checks
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
block-fixup:
7+
runs-on: ubuntu-18.04
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Block Fixup Commit Merge
12+
uses: 13rac1/block-fixup-merge-action@v2.0.0

.github/workflows/pr_todo_checks.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: PR TODO checks
2+
3+
on: pull_request
4+
5+
jobs:
6+
fixmes:
7+
name: New FIXMEs
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- run: git fetch origin ${GITHUB_BASE_REF}
12+
- name: Check for FIXMEs
13+
uses: luator/github_action_check_new_todos@v1
14+
with:
15+
label: FIXME
16+
base_ref: origin/${{ github.base_ref }}
17+
18+
todos:
19+
name: New TODOs
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
- run: git fetch origin ${GITHUB_BASE_REF}
24+
- name: Check for TODOs
25+
uses: luator/github_action_check_new_todos@v1
26+
with:
27+
label: TODO
28+
base_ref: origin/${{ github.base_ref }}

.github/workflows/style_checker.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Style Checker
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
black:
7+
name: Python Formatting
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-python@v4
12+
- uses: psf/black@stable
13+
14+
clang-format:
15+
name: C++ Formatting
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: actions/setup-python@v4
20+
- run: wget https://raw.githubusercontent.com/machines-in-motion/mpi_cmake_modules/master/scripts/run-clang-format
21+
- run: wget https://raw.githubusercontent.com/machines-in-motion/mpi_cmake_modules/master/resources/_clang-format
22+
- run: python ./run-clang-format -r .

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
*.pyc
3+
.idea
4+
build/
5+
results/
6+
new_results/
7+
latest_results/
8+
temp_results/
9+
results_after_merge/
10+
settings.json

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5+
6+
7+
## [Unreleased]
8+
9+
10+
## [1.0.0] - 2022-10-26
11+
### Added
12+
- `ProgramOptions` class (taken from trifinger_object_tracking)
13+
14+
15+
[Unreleased]: https://github.com/open-dynamic-robot-initiative/cli_utils/compare/v1.0.0...HEAD
16+
[1.0.0]: https://github.com/open-dynamic-robot-initiative/cli_utils/releases/tag/v1.0.0

CMakeLists.txt

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(cli_utils VERSION 1.0.0)
3+
4+
# Specify C++ Standard
5+
set(CMAKE_CXX_STANDARD 17)
6+
set(CMAKE_CXX_STANDARD_REQUIRED on)
7+
8+
include(CMakePackageConfigHelpers)
9+
include(GNUInstallDirs)
10+
11+
# stop build on first error
12+
string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra -Wfatal-errors -Werror=return-type")
13+
14+
find_package(Boost REQUIRED COMPONENTS program_options)
15+
16+
17+
## Libraries
18+
19+
add_library(program_options
20+
src/program_options.cpp
21+
)
22+
target_include_directories(program_options PUBLIC
23+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
24+
$<INSTALL_INTERFACE:include>
25+
)
26+
target_link_libraries(program_options PUBLIC
27+
Boost::program_options
28+
)
29+
30+
31+
## Tests
32+
33+
include(CTest)
34+
if (BUILD_TESTING)
35+
find_package(GTest CONFIG REQUIRED)
36+
include(GoogleTest)
37+
38+
add_executable(test_cli_utils
39+
test/main.cpp
40+
test/test_program_options.cpp
41+
)
42+
target_link_libraries(test_cli_utils
43+
program_options
44+
GTest::gtest
45+
)
46+
# declare the test as gtest
47+
gtest_add_tests(TARGET test_cli_utils)
48+
endif()
49+
50+
51+
## Installation
52+
53+
install(DIRECTORY include/${PROJECT_NAME}/
54+
DESTINATION include/${PROJECT_NAME})
55+
install(
56+
TARGETS
57+
program_options
58+
EXPORT ${PROJECT_NAME}Targets
59+
)
60+
61+
# Generate and install package config files
62+
install(EXPORT
63+
${PROJECT_NAME}Targets
64+
DESTINATION lib/cmake/${PROJECT_NAME}
65+
NAMESPACE ${PROJECT_NAME}::
66+
)
67+
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
68+
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
69+
INSTALL_DESTINATION lib/cmake/${PROJECT_NAME}
70+
)
71+
write_basic_package_version_file(
72+
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
73+
COMPATIBILITY SameMajorVersion
74+
)
75+
install(
76+
FILES
77+
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
78+
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
79+
DESTINATION lib/cmake/${PROJECT_NAME}
80+
)

Config.cmake.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@PACKAGE_INIT@
2+
3+
include(CMakeFindDependencyMacro)
4+
5+
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
6+
7+
find_dependency(Boost REQUIRED COMPONENTS program_options)
8+
9+
check_required_components(@PROJECT_NAME@)

0 commit comments

Comments
 (0)