From 05e01c85a42af991b1072415e2601d03d76a2e9f Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Sun, 21 May 2023 16:54:35 -0700 Subject: [PATCH 01/29] Update CI workflow Remove 18.04 since it is no longer supported by GitHub actions. Add 22.04. Signed-off-by: Jacob Perron --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 77852b5..7fb7d18 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-18.04, ubuntu-20.04] + os: [ubuntu-20.04, ubuntu-22.04] steps: - name: Install dependencies From a8e274be1559a5c921463629f57d5b6dfeed1583 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Sun, 21 May 2023 16:59:38 -0700 Subject: [PATCH 02/29] Update README Fix/remove broken or outdated links. Signed-off-by: Jacob Perron --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2d85f07..fa1232c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # libcreate # -C++ library for interfacing with iRobot's [Create 1 and 2](http://www.irobot.com/About-iRobot/STEM/Create-2.aspx) as well as most models of Roomba. [create_autonomy](http://wiki.ros.org/create_autonomy) is a [ROS](http://www.ros.org/) wrapper for this library. +C++ library for interfacing with iRobot's Create 1 and 2 as well as most models of Roomba. [create_robot](http://wiki.ros.org/create_robot) is a [ROS](http://www.ros.org/) wrapper for this library. -* [Code API](http://docs.ros.org/kinetic/api/libcreate/html/index.html) +* [Code API](http://docs.ros.org/noetic/api/libcreate/html/index.html) * Protocol documentation: - - [`V_1`](https://drive.google.com/file/d/0B9O4b91VYXMdUHlqNklDU09NU0k) (Roomba 400 series ) - - [`V_2`](https://drive.google.com/file/d/0B9O4b91VYXMdMmFPMVNDUEZ6d0U) (Create 1, Roomba 500 series) - - [`V_3`](https://drive.google.com/file/d/0B9O4b91VYXMdSVk4amw1N09mQ3c) (Create 2, Roomba 600-800 series) + - [`V_1`](https://drive.google.com/file/d/0B9O4b91VYXMdUHlqNklDU09NU0k/view?usp=sharing&resourcekey=0-KxMpRPBMsGAj7eSYC_9ewA) (Roomba 400 series ) + - [`V_2`](https://drive.google.com/file/d/0B9O4b91VYXMdMmFPMVNDUEZ6d0U/view?usp=sharing&resourcekey=0-bqKH8xhtWdYtTik_LLWo9Q) (Create 1, Roomba 500 series) + - [`V_3`](https://drive.google.com/file/d/0B9O4b91VYXMdSVk4amw1N09mQ3c/view?usp=sharing&resourcekey=0-rKvug2IzC7nj4zV31EJtww) (Create 2, Roomba 600-800 series) * Author: [Jacob Perron](http://jacobperron.ca) ([Autonomy Lab](http://autonomylab.org), [Simon Fraser University](http://www.sfu.ca)) * Contributors: [Mani Monajjemi](http:mani.im), [Ben Wolsieffer](https://github.com/lopsided98), [Josh Gadeken](https://github.com/process1183) From fd2638114aa57cd743d5632ce983b7edd4461edb Mon Sep 17 00:00:00 2001 From: DuSack1220 Date: Sat, 4 Feb 2023 17:03:31 +0100 Subject: [PATCH 03/29] added cliff sensor signals --- include/create/create.h | 20 ++++++++++++++++++++ src/create.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ src/data.cpp | 4 ++++ 3 files changed, 64 insertions(+) diff --git a/include/create/create.h b/include/create/create.h index 619205f..80beee3 100644 --- a/include/create/create.h +++ b/include/create/create.h @@ -406,6 +406,26 @@ namespace create { */ bool isCliffFrontRight() const; + /** + * \return true if the left sensor detects a cliff, false otherwise. + */ + uint16_t getCliffSignalLeft() const; + + /** + * \return true if the front left sensor detects a cliff, false otherwise. + */ + uint16_t getCliffSignalFrontLeft() const; + + /** + * \return true if the right sensor detects a cliff, false otherwise. + */ + uint16_t getCliffSignalRight() const; + + /** + * \return true if the front right sensor detects a cliff, false otherwise. + */ + uint16_t getCliffSignalFrontRight() const; + /** * \return true if there is a virtual wall signal is being received. */ diff --git a/src/create.cpp b/src/create.cpp index 0517b4a..72dbd26 100644 --- a/src/create.cpp +++ b/src/create.cpp @@ -738,6 +738,46 @@ namespace create { } } + uint16_t Create::getCliffSignalLeft() const { + if (data->isValidPacketID(ID_CLIFF_LEFT)) { + return GET_DATA(ID_CLIFF_LEFT_SIGNAL); + } + else { + CERR("[create::Create] ", "Left cliff sensor signals not supported!"); + return false; + } + } + + uint16_t Create::getCliffSignalFrontLeft() const { + if (data->isValidPacketID(ID_CLIFF_FRONT_LEFT)) { + return GET_DATA(ID_CLIFF_FRONT_LEFT_SIGNAL); + } + else { + CERR("[create::Create] ", "Front left cliff sensor signals not supported!"); + return false; + } + } + + uint16_t Create::getCliffSignalRight() const { + if (data->isValidPacketID(ID_CLIFF_RIGHT)) { + return GET_DATA(ID_CLIFF_RIGHT_SIGNAL); + } + else { + CERR("[create::Create] ", "Rightt cliff sensor signals not supported!"); + return false; + } + } + + uint16_t Create::getCliffSignalFrontRight() const { + if (data->isValidPacketID(ID_CLIFF_FRONT_RIGHT)) { + return GET_DATA(ID_CLIFF_FRONT_RIGHT_SIGNAL); + } + else { + CERR("[create::Create] ", "Front right cliff sensor signals not supported!"); + return false; + } + } + bool Create::isVirtualWall() const { if (data->isValidPacketID(ID_VIRTUAL_WALL)) { return GET_DATA(ID_VIRTUAL_WALL); diff --git a/src/data.cpp b/src/data.cpp index 5e8acce..be20717 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -16,6 +16,10 @@ namespace create { ADD_PACKET(ID_CLIFF_FRONT_LEFT, 1, "cliff_front_left", V_ALL); ADD_PACKET(ID_CLIFF_FRONT_RIGHT, 1, "cliff_front_right", V_ALL); ADD_PACKET(ID_CLIFF_RIGHT, 1, "cliff_right", V_ALL); + ADD_PACKET(ID_CLIFF_LEFT_SIGNAL, 2, "cliff_left_signal", V_3); + ADD_PACKET(ID_CLIFF_FRONT_LEFT_SIGNAL, 2, "cliff_front_left_signal", V_3); + ADD_PACKET(ID_CLIFF_FRONT_RIGHT_SIGNAL, 2, "cliff_front_right_signal", V_3); + ADD_PACKET(ID_CLIFF_RIGHT_SIGNAL, 2, "cliff_right_signal", V_3); ADD_PACKET(ID_VIRTUAL_WALL, 1, "virtual_wall", V_ALL); ADD_PACKET(ID_OVERCURRENTS, 1, "overcurrents", V_ALL); ADD_PACKET(ID_DIRT_DETECT_LEFT, 1, "dirt_detect_left", V_ALL); From 1bc2d768f7a1232fc31511d23910f3dfc45f1a63 Mon Sep 17 00:00:00 2001 From: DuSack1220 Date: Mon, 13 Mar 2023 23:49:10 +0100 Subject: [PATCH 04/29] fixed encoder overflow --- src/create.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/create.cpp b/src/create.cpp index 72dbd26..f6bd595 100644 --- a/src/create.cpp +++ b/src/create.cpp @@ -156,17 +156,23 @@ namespace create { // Compute ticks since last update int ticksLeft = totalTicksLeft - prevTicksLeft; int ticksRight = totalTicksRight - prevTicksRight; - prevTicksLeft = totalTicksLeft; - prevTicksRight = totalTicksRight; // Handle wrap around - if (std::abs(ticksLeft) > 0.9 * util::V_3_MAX_ENCODER_TICKS) { - ticksLeft = (ticksLeft % util::V_3_MAX_ENCODER_TICKS) + 1; + if (ticksLeft > 0.9 * util::V_3_MAX_ENCODER_TICKS) { + ticksLeft = 2 * util::V_3_MAX_ENCODER_TICKS + prevTicksLeft - ticksLeft; + } else if (ticksLeft < 0.9 * -util::V_3_MAX_ENCODER_TICKS) { + ticksLeft = util::V_3_MAX_ENCODER_TICKS - prevTicksLeft + util::V_3_MAX_ENCODER_TICKS + ticksLeft; } - if (std::abs(ticksRight) > 0.9 * util::V_3_MAX_ENCODER_TICKS) { - ticksRight = (ticksRight % util::V_3_MAX_ENCODER_TICKS) + 1; + + if (ticksRight > 0.9 * util::V_3_MAX_ENCODER_TICKS) { + ticksRight = util::V_3_MAX_ENCODER_TICKS + prevTicksRight + util::V_3_MAX_ENCODER_TICKS - ticksRight; + } else if (ticksLeft < 0.9 * -util::V_3_MAX_ENCODER_TICKS) { + ticksRight = util::V_3_MAX_ENCODER_TICKS - prevTicksRight + util::V_3_MAX_ENCODER_TICKS + ticksRight; } + prevTicksLeft = totalTicksLeft; + prevTicksRight = totalTicksRight; + // Compute distance travelled by each wheel leftWheelDist = (ticksLeft / util::V_3_TICKS_PER_REV) * model.getWheelDiameter() * util::PI; From 2c58777e45a431e88c3e01854e369187389641f2 Mon Sep 17 00:00:00 2001 From: Bernhard Klauninger Date: Wed, 15 Mar 2023 13:14:06 +0100 Subject: [PATCH 05/29] Actually fixed wrap around --- src/create.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/create.cpp b/src/create.cpp index f6bd595..87c12c9 100644 --- a/src/create.cpp +++ b/src/create.cpp @@ -157,18 +157,18 @@ namespace create { int ticksLeft = totalTicksLeft - prevTicksLeft; int ticksRight = totalTicksRight - prevTicksRight; - // Handle wrap around - if (ticksLeft > 0.9 * util::V_3_MAX_ENCODER_TICKS) { - ticksLeft = 2 * util::V_3_MAX_ENCODER_TICKS + prevTicksLeft - ticksLeft; - } else if (ticksLeft < 0.9 * -util::V_3_MAX_ENCODER_TICKS) { - ticksLeft = util::V_3_MAX_ENCODER_TICKS - prevTicksLeft + util::V_3_MAX_ENCODER_TICKS + ticksLeft; - } + // Handle wrap around + if (ticksLeft > 0.9 * util::V_3_MAX_ENCODER_TICKS) { + ticksLeft -= util::V_3_MAX_ENCODER_TICKS; + } else if (ticksLeft < -0.9 * util::V_3_MAX_ENCODER_TICKS) { + ticksLeft += util::V_3_MAX_ENCODER_TICKS; + } - if (ticksRight > 0.9 * util::V_3_MAX_ENCODER_TICKS) { - ticksRight = util::V_3_MAX_ENCODER_TICKS + prevTicksRight + util::V_3_MAX_ENCODER_TICKS - ticksRight; - } else if (ticksLeft < 0.9 * -util::V_3_MAX_ENCODER_TICKS) { - ticksRight = util::V_3_MAX_ENCODER_TICKS - prevTicksRight + util::V_3_MAX_ENCODER_TICKS + ticksRight; - } + if (ticksRight > 0.9 * util::V_3_MAX_ENCODER_TICKS) { + ticksRight -= util::V_3_MAX_ENCODER_TICKS; + } else if (ticksRight < -0.9 * util::V_3_MAX_ENCODER_TICKS) { + ticksRight += util::V_3_MAX_ENCODER_TICKS; + } prevTicksLeft = totalTicksLeft; prevTicksRight = totalTicksRight; From 7ade48545ed27d3beb6b7e823d75386b3cfc70f5 Mon Sep 17 00:00:00 2001 From: DuSack1220 Date: Wed, 15 Mar 2023 15:28:46 +0100 Subject: [PATCH 06/29] fixed cliff signal documentation --- include/create/create.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/create/create.h b/include/create/create.h index 80beee3..512d264 100644 --- a/include/create/create.h +++ b/include/create/create.h @@ -407,22 +407,22 @@ namespace create { bool isCliffFrontRight() const; /** - * \return true if the left sensor detects a cliff, false otherwise. + * \return the IR value of the left cliff sensor. */ uint16_t getCliffSignalLeft() const; /** - * \return true if the front left sensor detects a cliff, false otherwise. + * \return the IR value of the front left cliff sensor. */ uint16_t getCliffSignalFrontLeft() const; /** - * \return true if the right sensor detects a cliff, false otherwise. + * \return the IR value of the right cliff sensor. */ uint16_t getCliffSignalRight() const; /** - * \return true if the front right sensor detects a cliff, false otherwise. + * \return the IR value of the front right cliff sensor. */ uint16_t getCliffSignalFrontRight() const; From d3a714cc51a68c86cc5aca1e5c51f4a10fecefe5 Mon Sep 17 00:00:00 2001 From: Joel Klimont Date: Fri, 3 May 2024 00:17:37 +0200 Subject: [PATCH 07/29] changed install dir --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 553f469..4fb7345 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,8 @@ endforeach() # Configuration # ################# +set(CMAKE_INSTALL_PREFIX "/usr/") + # Install directories layout: # * /lib/ # * /bin/ From aaa7b5076ee6175512f8be2ac9fc107118bf50da Mon Sep 17 00:00:00 2001 From: Bernhard Klauninger Date: Wed, 3 Jul 2024 16:13:33 +0200 Subject: [PATCH 08/29] Implemented Create reset method --- CMakeLists.txt | 2 +- include/create/create.h | 5 +++++ src/create.cpp | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fb7345..ce7beb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,7 +84,7 @@ endforeach() # Configuration # ################# -set(CMAKE_INSTALL_PREFIX "/usr/") +# set(CMAKE_INSTALL_PREFIX "/usr/") // complib needs this, riplib doesn't # Install directories layout: # * /lib/ diff --git a/include/create/create.h b/include/create/create.h index 512d264..186192e 100644 --- a/include/create/create.h +++ b/include/create/create.h @@ -135,6 +135,11 @@ namespace create { */ ~Create(); + /** + * \brief Resets the create as if the battery was removed and reinserted. + */ + void reset(); + /** * \brief Make a serial connection to Create. * diff --git a/src/create.cpp b/src/create.cpp index 87c12c9..75f28c5 100644 --- a/src/create.cpp +++ b/src/create.cpp @@ -67,6 +67,15 @@ namespace create { disconnect(); } + void Create::reset() { + if (!connected()) { + CERR("[create::Serial] ", "send failed, not connected."); + return; + } + serial->sendOpcode(OC_START); + serial->sendOpcode(OC_RESET); + } + Create::Matrix Create::addMatrices(const Matrix &A, const Matrix &B) const { size_t rows = A.size1(); size_t cols = A.size2(); From 8b5167b3192bfb7b01206f441a1b8e62062df2ec Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Sun, 22 Sep 2024 18:13:22 +0200 Subject: [PATCH 09/29] fix tests for new cliff packets, add string to packet.h --- include/create/packet.h | 1 + tests/test_data.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/create/packet.h b/include/create/packet.h index d1e7928..60ff0f2 100644 --- a/include/create/packet.h +++ b/include/create/packet.h @@ -32,6 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. #define CREATE_PACKET_H #include +#include namespace create { class Packet { diff --git a/tests/test_data.cpp b/tests/test_data.cpp index e9752a0..e347fb1 100644 --- a/tests/test_data.cpp +++ b/tests/test_data.cpp @@ -65,11 +65,11 @@ TEST(DataTest, GetNumPackets) create::Data data_v_3(create::V_3); // Number exclusive to V_3 = 13 - // 17 + 13 = 30 - EXPECT_EQ(static_cast(data_v_3.getNumPackets()), 30); + // 17 + 17 = 34 + EXPECT_EQ(static_cast(data_v_3.getNumPackets()), 34); create::Data data_v_all(create::V_ALL); - EXPECT_EQ(static_cast(data_v_all.getNumPackets()), 33); + EXPECT_EQ(static_cast(data_v_all.getNumPackets()), 37); } TEST(DataTest, GetPacket) @@ -108,7 +108,7 @@ TEST(DataTest, GetPacketIDs) create::Data data_v_3(create::V_3); const std::vector packet_ids = data_v_3.getPacketIDs(); // Vector should have same length as reported by getNumPackets() - ASSERT_EQ(static_cast(packet_ids.size()), 30); + ASSERT_EQ(static_cast(packet_ids.size()), 34); // Vector should contain ID_LEFT_ENC bool found = false; @@ -133,9 +133,9 @@ TEST(DataTest, GetTotalDataBytes) create::Data data_v_2(create::V_2); EXPECT_EQ(static_cast(data_v_2.getTotalDataBytes()), 26); - // V_3 has an additional 21 bytes + // V_3 has an additional 29 bytes create::Data data_v_3(create::V_3); - EXPECT_EQ(static_cast(data_v_3.getTotalDataBytes()), 42); + EXPECT_EQ(static_cast(data_v_3.getTotalDataBytes()), 50); } TEST(DataTest, IsValidPacketID) From 7ae7155f25c484d9c328115a60cd992887b99ab6 Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Sun, 22 Sep 2024 18:29:51 +0200 Subject: [PATCH 10/29] ci: add Packing cmake and dockerfile to run packing --- .dockerignore | 2 ++ CMakeLists.txt | 9 +++++++- ci/Dockerfile | 17 +++++++++++++++ cmake/Packing.cmake | 50 +++++++++++++++++++++++++++++++++++++++++++++ package.sh | 0 5 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 ci/Dockerfile create mode 100644 cmake/Packing.cmake create mode 100755 package.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7846b39 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.github +ci \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index ce7beb2..2d37b18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ # target_link_libraries(... ${libcreate_LIBRARIES}) # -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.28) project(libcreate) add_compile_options(-Wall -Wextra -Wpedantic) @@ -203,3 +203,10 @@ if(LIBCREATE_BUILD_TESTS AND ${GTEST_FOUND}) else() message("No GTest installation found. Skipping tests.") endif() + +############# +# Packaging # +############# + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +include(Packing) \ No newline at end of file diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 0000000..c303ca9 --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,17 @@ +FROM ubuntu:24.04 + +RUN apt update && \ + apt install -y \ + build-essential cmake file \ + libboost-system-dev libboost-thread-dev \ + libgtest-dev googletest && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /libcreate +COPY . . + +WORKDIR /libcreate/build +RUN cmake -B /libcreate/build -S /libcreate -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Werror" && \ + cmake --build /libcreate/build --config Release && \ + ctest -C Release --output-on-failure && \ + cpack --build /libcreate/build -G DEB diff --git a/cmake/Packing.cmake b/cmake/Packing.cmake new file mode 100644 index 0000000..93b1feb --- /dev/null +++ b/cmake/Packing.cmake @@ -0,0 +1,50 @@ +# these are cache variables, so they could be overwritten with -D, +set(CPACK_PACKAGE_NAME ${PROJECT_NAME} + CACHE STRING "The resulting package name" +) +# which is useful in case of packing only selected components instead of the whole thing +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "C++ library for interfacing with iRobot's Create 1 and 2" + CACHE STRING "Package description for the package metadata" +) +set(CPACK_PACKAGE_VENDOR "Verein zur Förderung von Jugendlichen durch Robotikwettbewerbe") + +set(CPACK_VERBATIM_VARIABLES YES) + +set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) +SET(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_SOURCE_DIR}/_packages") + +# https://unix.stackexchange.com/a/11552/254512 +set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/some")#/${CMAKE_PROJECT_VERSION}") + +set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) + +set(CPACK_PACKAGE_CONTACT "kontakt@comp-air.at") +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "comp-air dev team") + +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") +set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") + +# Discover and set dependencies correcly +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS YES) + +# The installation path directory should have 0755 permissions +set( + CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE +) + +# package name for deb. If set, then instead of some-application-0.9.2-Linux.deb +# you'll get some-application_0.9.2_amd64.deb (note the underscores too) +set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) +# that is if you want every group to have its own package, +# although the same will happen if this is not set (so it defaults to ONE_PER_GROUP) +# and CPACK_DEB_COMPONENT_INSTALL is set to YES +set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)#ONE_PER_GROUP) +# without this you won't be able to pack only specified component +set(CPACK_DEB_COMPONENT_INSTALL YES) + +include(CPack) \ No newline at end of file diff --git a/package.sh b/package.sh new file mode 100755 index 0000000..e69de29 From 1791063fa8644434c001b50b8543bad698ae713c Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Mon, 23 Sep 2024 13:34:10 +0200 Subject: [PATCH 11/29] cmake: add versioning module --- CMakeLists.txt | 20 +++++++++++++++++--- cmake/Versioning.cmake | 26 ++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 cmake/Versioning.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d37b18..54d6ded 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,15 @@ +######### +# Setup # +######### + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + +include(Versioning) + +######## +# Main # +######## + # After installation this project can be found by 'find_package' command: # # find_package(libcreate REQUIRED) @@ -6,11 +18,14 @@ # cmake_minimum_required(VERSION 3.28) -project(libcreate) +project( + libcreate + VERSION ${TAG_VERSION_MAJOR}.${TAG_VERSION_MINOR}.${TAG_VERSION_PATCH} +) add_compile_options(-Wall -Wextra -Wpedantic) -set(PACKAGE_VERSION 3.0.0) +set(PACKAGE_VERSION ${TAG_VERSION_MAJOR}.${TAG_VERSION_MINOR}.${TAG_VERSION_PATCH}) option(LIBCREATE_BUILD_TESTS "Enable the build of tests." ON) @@ -208,5 +223,4 @@ endif() # Packaging # ############# -set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(Packing) \ No newline at end of file diff --git a/cmake/Versioning.cmake b/cmake/Versioning.cmake new file mode 100644 index 0000000..b082127 --- /dev/null +++ b/cmake/Versioning.cmake @@ -0,0 +1,26 @@ +find_package(Git) + +if(GIT_EXECUTABLE) + execute_process( + COMMAND ${GIT_EXECUTABLE} describe --tags + OUTPUT_VARIABLE TAG_VERSION + RESULT_VARIABLE ERROR_CODE + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if(TAG_VERSION STREQUAL "") + set(TAG_VERSION 0.0.0) + message(WARNING "Failed to determine version from Git tags. Using default version \"${TAG_VERSION}\".") + endif() + + message(STATUS "Project version: ${TAG_VERSION}") + + # Split into major, minor, patch + string( + REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" + TAG_VERSION_MATCH ${TAG_VERSION} + ) + set(TAG_VERSION_MAJOR ${CMAKE_MATCH_1}) + set(TAG_VERSION_MINOR ${CMAKE_MATCH_2}) + set(TAG_VERSION_PATCH ${CMAKE_MATCH_3}) +endif() \ No newline at end of file From 3836d1480b3b9e9a773464d895ce4ffc2182537d Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Mon, 23 Sep 2024 13:34:34 +0200 Subject: [PATCH 12/29] ci: add packing job --- .dockerignore | 2 +- .github/workflows/ci.yaml | 38 ---------------------------------- .github/workflows/package.yaml | 29 ++++++++++++++++++++++++++ .github/workflows/test.yaml | 30 +++++++++++++++++++++++++++ ci/Dockerfile | 7 ++----- ci/entrypoint.sh | 10 +++++++++ 6 files changed, 72 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/package.yaml create mode 100644 .github/workflows/test.yaml create mode 100755 ci/entrypoint.sh diff --git a/.dockerignore b/.dockerignore index 7846b39..d71d4b3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,2 @@ .github -ci \ No newline at end of file +ci/Dockerfile \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 7fb7d18..0000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build and test - -on: - push: - branches: ['master'] - pull_request: - -env: - BUILD_TYPE: Release - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-20.04, ubuntu-22.04] - - steps: - - name: Install dependencies - run: | - sudo apt install build-essential cmake git libboost-system-dev libboost-thread-dev - git clone https://github.com/google/googletest.git - cd googletest - cmake CMakeLists.txt - make - sudo make install - - - uses: actions/checkout@v2 - - - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-Werror" - - - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build - run: ctest -C ${{env.BUILD_TYPE}} diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml new file mode 100644 index 0000000..bbc7e80 --- /dev/null +++ b/.github/workflows/package.yaml @@ -0,0 +1,29 @@ +name: Package + +on: + push: + +jobs: + package: + runs-on: ubuntu-24.04 + strategy: + matrix: + platform: [linux/arm64/v8] + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/arm64 + + - name: Prepare container + run: docker buildx build -f ci/Dockerfile . -t libcreate --platform ${{ matrix.platform }} --load + - name: Build + run: docker run --platform ${{ matrix.platform }} -v ./output:/libcreate/_packages libcreate diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..986dc29 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,30 @@ +name: Build and test + +on: + push: + branches: ["master"] + pull_request: + +env: + BUILD_TYPE: Release + +jobs: + test: + runs-on: ubuntu-24.04 + + steps: + - name: Install dependencies + run: | + sudo apt install build-essential cmake git libboost-system-dev libboost-thread-dev file libgtest-dev googletest + + - uses: actions/checkout@v4 + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-Werror" + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + run: ctest -C ${{env.BUILD_TYPE}} diff --git a/ci/Dockerfile b/ci/Dockerfile index c303ca9..6516bf9 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:24.04 RUN apt update && \ apt install -y \ - build-essential cmake file \ + build-essential cmake git file \ libboost-system-dev libboost-thread-dev \ libgtest-dev googletest && \ rm -rf /var/lib/apt/lists/* @@ -11,7 +11,4 @@ WORKDIR /libcreate COPY . . WORKDIR /libcreate/build -RUN cmake -B /libcreate/build -S /libcreate -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Werror" && \ - cmake --build /libcreate/build --config Release && \ - ctest -C Release --output-on-failure && \ - cpack --build /libcreate/build -G DEB +ENTRYPOINT ["/bin/bash", "/libcreate/ci/entrypoint.sh"] diff --git a/ci/entrypoint.sh b/ci/entrypoint.sh new file mode 100755 index 0000000..c371918 --- /dev/null +++ b/ci/entrypoint.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -o errexit +set -o nounset +set -o pipefail + +cmake -B /libcreate/build -S /libcreate -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS='-Werror' +cmake --build /libcreate/build --config Release +ctest -C Release --output-on-failure +cpack --build /libcreate/build -G DEB \ No newline at end of file From efd9cf02c9229f5f1776f8579f1d447098c547ee Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Mon, 23 Sep 2024 14:06:29 +0200 Subject: [PATCH 13/29] ci: add tag extraction from github_ref var --- .github/workflows/package.yaml | 2 ++ cmake/Versioning.cmake | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index bbc7e80..1253655 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -2,6 +2,8 @@ name: Package on: push: + tags: + - "**" jobs: package: diff --git a/cmake/Versioning.cmake b/cmake/Versioning.cmake index b082127..7665011 100644 --- a/cmake/Versioning.cmake +++ b/cmake/Versioning.cmake @@ -8,6 +8,11 @@ if(GIT_EXECUTABLE) OUTPUT_STRIP_TRAILING_WHITESPACE ) + if(DEFINED ENV{GITHUB_REF}) + set(TAG_VERSION $ENV{GITHUB_REF}) + message(STATUS "Extracted version from GITHUB_REF") + endif() + if(TAG_VERSION STREQUAL "") set(TAG_VERSION 0.0.0) message(WARNING "Failed to determine version from Git tags. Using default version \"${TAG_VERSION}\".") From f8b977336a6372d0bcef1099d85c7ac4c30272ce Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Mon, 23 Sep 2024 14:09:47 +0200 Subject: [PATCH 14/29] ci: change tag filter --- .github/workflows/package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 1253655..04fc237 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -3,7 +3,7 @@ name: Package on: push: tags: - - "**" + - "*" jobs: package: From 1979a5d4058cce3b49f700d42285cd5b8b2d9535 Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Mon, 23 Sep 2024 14:31:09 +0200 Subject: [PATCH 15/29] ci: add push to compREP --- .github/workflows/package.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 04fc237..3fe9610 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -29,3 +29,11 @@ jobs: run: docker buildx build -f ci/Dockerfile . -t libcreate --platform ${{ matrix.platform }} --load - name: Build run: docker run --platform ${{ matrix.platform }} -v ./output:/libcreate/_packages libcreate + - name: Push deb to compREP + uses: cpina/github-action-push-to-another-repository@main + with: + source-directory: "output/" + target-directory: "debs/complib/" + destination-github-username: "F-WuTS" + destination-repository-name: "compREP" + target-branch: master From 52201a39324e6d0c0b04b20d44dbd0ef343c04db Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Mon, 23 Sep 2024 15:51:44 +0200 Subject: [PATCH 16/29] ci: fix SSH_DEPLOY_KEY env var --- .github/workflows/package.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 3fe9610..113c7bb 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -31,6 +31,8 @@ jobs: run: docker run --platform ${{ matrix.platform }} -v ./output:/libcreate/_packages libcreate - name: Push deb to compREP uses: cpina/github-action-push-to-another-repository@main + env: + SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} with: source-directory: "output/" target-directory: "debs/complib/" From f3cafc241d96b60b89d6522a0ae40ee67faeced3 Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Mon, 23 Sep 2024 17:12:41 +0200 Subject: [PATCH 17/29] ci: change from ubuntu base to debian base --- CMakeLists.txt | 3 ++- ci/Dockerfile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54d6ded..007b56b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ # Setup # ######### +cmake_minimum_required(VERSION 3.25) + set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(Versioning) @@ -17,7 +19,6 @@ include(Versioning) # target_link_libraries(... ${libcreate_LIBRARIES}) # -cmake_minimum_required(VERSION 3.28) project( libcreate VERSION ${TAG_VERSION_MAJOR}.${TAG_VERSION_MINOR}.${TAG_VERSION_PATCH} diff --git a/ci/Dockerfile b/ci/Dockerfile index 6516bf9..3274bbe 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:24.04 +FROM debian:bookworm RUN apt update && \ apt install -y \ From 78424d187c78b34df71efae599b06f4dca96665e Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Mon, 23 Sep 2024 21:13:21 +0200 Subject: [PATCH 18/29] cmake: do not install to opt --- ci/Dockerfile | 2 +- ci/entrypoint.sh | 7 ++++++- cmake/Packing.cmake | 9 --------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index 3274bbe..bf82ed3 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -2,7 +2,7 @@ FROM debian:bookworm RUN apt update && \ apt install -y \ - build-essential cmake git file \ + build-essential cmake git file tree \ libboost-system-dev libboost-thread-dev \ libgtest-dev googletest && \ rm -rf /var/lib/apt/lists/* diff --git a/ci/entrypoint.sh b/ci/entrypoint.sh index c371918..680207f 100755 --- a/ci/entrypoint.sh +++ b/ci/entrypoint.sh @@ -7,4 +7,9 @@ set -o pipefail cmake -B /libcreate/build -S /libcreate -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS='-Werror' cmake --build /libcreate/build --config Release ctest -C Release --output-on-failure -cpack --build /libcreate/build -G DEB \ No newline at end of file +cpack --build /libcreate/build -G DEB + +debs=(/libcreate/_packages/*.deb) +cp "${debs[0]}" /tmp/libcreate.deb +dpkg-deb -R /tmp/libcreate.deb /tmp/libcreate +tree /tmp/libcreate \ No newline at end of file diff --git a/cmake/Packing.cmake b/cmake/Packing.cmake index 93b1feb..58d81b8 100644 --- a/cmake/Packing.cmake +++ b/cmake/Packing.cmake @@ -13,9 +13,6 @@ set(CPACK_VERBATIM_VARIABLES YES) set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) SET(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_SOURCE_DIR}/_packages") -# https://unix.stackexchange.com/a/11552/254512 -set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/some")#/${CMAKE_PROJECT_VERSION}") - set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) @@ -40,11 +37,5 @@ set( # package name for deb. If set, then instead of some-application-0.9.2-Linux.deb # you'll get some-application_0.9.2_amd64.deb (note the underscores too) set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) -# that is if you want every group to have its own package, -# although the same will happen if this is not set (so it defaults to ONE_PER_GROUP) -# and CPACK_DEB_COMPONENT_INSTALL is set to YES -set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)#ONE_PER_GROUP) -# without this you won't be able to pack only specified component -set(CPACK_DEB_COMPONENT_INSTALL YES) include(CPack) \ No newline at end of file From 3ac90c382e5db2b87348264add23be3bcdd455a7 Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Mon, 23 Sep 2024 22:46:52 +0200 Subject: [PATCH 19/29] ci: change target-dir in comprep to debs/libcreate --- .github/workflows/package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 113c7bb..5a1e8f4 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -35,7 +35,7 @@ jobs: SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} with: source-directory: "output/" - target-directory: "debs/complib/" + target-directory: "debs/libcreate/" destination-github-username: "F-WuTS" destination-repository-name: "compREP" target-branch: master From e51895fa18a9599a3173975679d39bb691e69afb Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Wed, 25 Sep 2024 21:54:46 +0200 Subject: [PATCH 20/29] cmake: add default Werror, extract version only from GITHUB_REF if tag --- .github/workflows/test.yaml | 2 +- CMakeLists.txt | 2 +- cmake/Versioning.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 986dc29..fb0bcce 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v4 - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-Werror" + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - name: Build run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} diff --git a/CMakeLists.txt b/CMakeLists.txt index 007b56b..e39cf16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ project( VERSION ${TAG_VERSION_MAJOR}.${TAG_VERSION_MINOR}.${TAG_VERSION_PATCH} ) -add_compile_options(-Wall -Wextra -Wpedantic) +add_compile_options(-Wall -Wextra -Wpedantic -Werror) set(PACKAGE_VERSION ${TAG_VERSION_MAJOR}.${TAG_VERSION_MINOR}.${TAG_VERSION_PATCH}) diff --git a/cmake/Versioning.cmake b/cmake/Versioning.cmake index 7665011..d659c5c 100644 --- a/cmake/Versioning.cmake +++ b/cmake/Versioning.cmake @@ -8,7 +8,7 @@ if(GIT_EXECUTABLE) OUTPUT_STRIP_TRAILING_WHITESPACE ) - if(DEFINED ENV{GITHUB_REF}) + if(DEFINED ENV{GITHUB_REF} AND ENV{GITHUB_REF_TYPE} EQUAL "tag") set(TAG_VERSION $ENV{GITHUB_REF}) message(STATUS "Extracted version from GITHUB_REF") endif() From 5a591cfbbad809c82f1d9370418ae9b01ab18348 Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Wed, 25 Sep 2024 21:58:36 +0200 Subject: [PATCH 21/29] ci: remove Werror from entrypoint --- ci/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/entrypoint.sh b/ci/entrypoint.sh index 680207f..779d753 100755 --- a/ci/entrypoint.sh +++ b/ci/entrypoint.sh @@ -4,7 +4,7 @@ set -o errexit set -o nounset set -o pipefail -cmake -B /libcreate/build -S /libcreate -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS='-Werror' +cmake -B /libcreate/build -S /libcreate -DCMAKE_BUILD_TYPE=Release cmake --build /libcreate/build --config Release ctest -C Release --output-on-failure cpack --build /libcreate/build -G DEB From d07add7a9130133eddf1fa73f9e7bb5b2afd503c Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Thu, 26 Sep 2024 09:20:57 +0200 Subject: [PATCH 22/29] chore: delete empty file Signed-off-by: Christoph Heiss --- package.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 package.sh diff --git a/package.sh b/package.sh deleted file mode 100755 index e69de29..0000000 From f49a76c7e4d360d1bb515ba690753066dbb23876 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Thu, 26 Sep 2024 09:21:10 +0200 Subject: [PATCH 23/29] gitignore: add cmake/cpack output directories Signed-off-by: Christoph Heiss --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..28408a6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# CMake/CPack +build/ +_packages/ From 8df56b61badb4cd7c44cfeca81e1934736345bac Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Mon, 7 Oct 2024 11:55:33 +0200 Subject: [PATCH 24/29] ci: switch workflows to `Default` runner group Signed-off-by: Christoph Heiss --- .github/workflows/package.yaml | 4 +++- .github/workflows/test.yaml | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 5a1e8f4..32188e0 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -7,7 +7,9 @@ on: jobs: package: - runs-on: ubuntu-24.04 + runs-on: + group: Default + strategy: matrix: platform: [linux/arm64/v8] diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fb0bcce..00f8247 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,7 +2,8 @@ name: Build and test on: push: - branches: ["master"] + branches: + - master pull_request: env: @@ -10,7 +11,8 @@ env: jobs: test: - runs-on: ubuntu-24.04 + runs-on: + group: Default steps: - name: Install dependencies From f07973e42645c84ba4378ad9fe087689b54f59f1 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Tue, 8 Oct 2024 11:48:52 +0200 Subject: [PATCH 25/29] Revert "ci: switch workflows to `Default` runner group" This reverts commit 8df56b61badb4cd7c44cfeca81e1934736345bac. --- .github/workflows/package.yaml | 4 +--- .github/workflows/test.yaml | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 32188e0..5a1e8f4 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -7,9 +7,7 @@ on: jobs: package: - runs-on: - group: Default - + runs-on: ubuntu-24.04 strategy: matrix: platform: [linux/arm64/v8] diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 00f8247..fb0bcce 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,8 +2,7 @@ name: Build and test on: push: - branches: - - master + branches: ["master"] pull_request: env: @@ -11,8 +10,7 @@ env: jobs: test: - runs-on: - group: Default + runs-on: ubuntu-24.04 steps: - name: Install dependencies From 6c8a7b3accb0a68e92b38ca8160f20827f0cef27 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Fri, 6 Jun 2025 20:15:42 +0200 Subject: [PATCH 26/29] ci: switch to forgejo actions Signed-off-by: Christoph Heiss --- .forgejo/workflows/package.yaml | 64 +++++++++++++++++++++++++++++++++ .forgejo/workflows/test.yaml | 34 ++++++++++++++++++ .github/workflows/package.yaml | 41 --------------------- .github/workflows/test.yaml | 30 ---------------- ci/Dockerfile | 14 -------- ci/entrypoint.sh | 15 -------- 6 files changed, 98 insertions(+), 100 deletions(-) create mode 100644 .forgejo/workflows/package.yaml create mode 100644 .forgejo/workflows/test.yaml delete mode 100644 .github/workflows/package.yaml delete mode 100644 .github/workflows/test.yaml delete mode 100644 ci/Dockerfile delete mode 100755 ci/entrypoint.sh diff --git a/.forgejo/workflows/package.yaml b/.forgejo/workflows/package.yaml new file mode 100644 index 0000000..f47b5e4 --- /dev/null +++ b/.forgejo/workflows/package.yaml @@ -0,0 +1,64 @@ +--- +name: Package + +on: + push: + tags: + - "*" + +jobs: + package: + strategy: + matrix: + platform: + - dpkg: arm64 + runs-on: debian-12-arm64 + + runs-on: debian-12-arm64 + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + + - name: Install dependencies + run: | + apt update + apt install -y \ + build-essential cmake git libboost-system-dev libboost-thread-dev file libgtest-dev googletest + + - uses: actions/checkout@v4 + + - name: configure + run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCPACK_DEBIAN_PACKAGE_RELEASE=compair1 + + - name: build + run: cmake --build build --config Release -j2 + + - name: test + working-directory: build + run: ctest -C Release + + - name: build deb + working-directory: build + run: cpack --build . -G DEB + + - name: get tag + run: | + echo "TAG=$(git describe --abbrev=0 --tags)-compair1" >>$GITHUB_ENV + + # https://forgejo.org/docs/latest/user/packages/debian/#publish-a-package + - name: push deb to apt repository + env: + REPO: ${{ github.repository }} + run: | + url="${GITHUB_SERVER_URL}/api/packages/${{ github.repository_owner }}/debian/pool/bookworm/compair/upload" + echo "api url: $url" + debfile="_packages/libcreate_${TAG}_${{ matrix.platform.dpkg }}.deb" + echo "uploading file: $debfile" + curl --fail-with-body \ + -X PUT \ + --user "oauth2:${{ secrets.PACKAGE_REGISTRY_TOKEN }}" \ + --upload-file "$debfile" \ + "$url" + echo "final url: ${GITHUB_SERVER_URL}/${{ github.repository_owner }}/-/packages/debian/libcreate/${TAG}" diff --git a/.forgejo/workflows/test.yaml b/.forgejo/workflows/test.yaml new file mode 100644 index 0000000..2b55f1a --- /dev/null +++ b/.forgejo/workflows/test.yaml @@ -0,0 +1,34 @@ +--- +name: Build and test + +on: + push: + branches: + - master + pull_request: + +env: + BUILD_TYPE: Release + +jobs: + test: + runs-on: debian-12 + + steps: + - name: Install dependencies + run: | + apt update + apt install -y \ + build-essential cmake git libboost-system-dev libboost-thread-dev file libgtest-dev googletest + + - uses: actions/checkout@v4 + + - name: Configure CMake + run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + + - name: Build + run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} + + - name: Test + working-directory: ${{ github.workspace }}/build + run: ctest -C ${{ env.BUILD_TYPE }} diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml deleted file mode 100644 index 5a1e8f4..0000000 --- a/.github/workflows/package.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: Package - -on: - push: - tags: - - "*" - -jobs: - package: - runs-on: ubuntu-24.04 - strategy: - matrix: - platform: [linux/arm64/v8] - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - platforms: linux/arm64 - - - name: Prepare container - run: docker buildx build -f ci/Dockerfile . -t libcreate --platform ${{ matrix.platform }} --load - - name: Build - run: docker run --platform ${{ matrix.platform }} -v ./output:/libcreate/_packages libcreate - - name: Push deb to compREP - uses: cpina/github-action-push-to-another-repository@main - env: - SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} - with: - source-directory: "output/" - target-directory: "debs/libcreate/" - destination-github-username: "F-WuTS" - destination-repository-name: "compREP" - target-branch: master diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index fb0bcce..0000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: Build and test - -on: - push: - branches: ["master"] - pull_request: - -env: - BUILD_TYPE: Release - -jobs: - test: - runs-on: ubuntu-24.04 - - steps: - - name: Install dependencies - run: | - sudo apt install build-essential cmake git libboost-system-dev libboost-thread-dev file libgtest-dev googletest - - - uses: actions/checkout@v4 - - - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build - run: ctest -C ${{env.BUILD_TYPE}} diff --git a/ci/Dockerfile b/ci/Dockerfile deleted file mode 100644 index bf82ed3..0000000 --- a/ci/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM debian:bookworm - -RUN apt update && \ - apt install -y \ - build-essential cmake git file tree \ - libboost-system-dev libboost-thread-dev \ - libgtest-dev googletest && \ - rm -rf /var/lib/apt/lists/* - -WORKDIR /libcreate -COPY . . - -WORKDIR /libcreate/build -ENTRYPOINT ["/bin/bash", "/libcreate/ci/entrypoint.sh"] diff --git a/ci/entrypoint.sh b/ci/entrypoint.sh deleted file mode 100755 index 779d753..0000000 --- a/ci/entrypoint.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -cmake -B /libcreate/build -S /libcreate -DCMAKE_BUILD_TYPE=Release -cmake --build /libcreate/build --config Release -ctest -C Release --output-on-failure -cpack --build /libcreate/build -G DEB - -debs=(/libcreate/_packages/*.deb) -cp "${debs[0]}" /tmp/libcreate.deb -dpkg-deb -R /tmp/libcreate.deb /tmp/libcreate -tree /tmp/libcreate \ No newline at end of file From 661fa82f6e620ba2288d94f733d6891ec4e159e9 Mon Sep 17 00:00:00 2001 From: "jakob.kampichler" Date: Fri, 6 Jun 2025 18:35:09 +0000 Subject: [PATCH 27/29] ci: also include Botball repo --- .forgejo/workflows/package.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.forgejo/workflows/package.yaml b/.forgejo/workflows/package.yaml index f47b5e4..2007e54 100644 --- a/.forgejo/workflows/package.yaml +++ b/.forgejo/workflows/package.yaml @@ -53,12 +53,24 @@ jobs: REPO: ${{ github.repository }} run: | url="${GITHUB_SERVER_URL}/api/packages/${{ github.repository_owner }}/debian/pool/bookworm/compair/upload" + urlBotball="${GITHUB_SERVER_URL}/api/packages/Botball/debian/pool/bookworm/wombatos/upload" + echo "api url: $url" debfile="_packages/libcreate_${TAG}_${{ matrix.platform.dpkg }}.deb" + echo "uploading file: $debfile" curl --fail-with-body \ -X PUT \ --user "oauth2:${{ secrets.PACKAGE_REGISTRY_TOKEN }}" \ --upload-file "$debfile" \ "$url" + + echo "uploading file for WombatOs: $debfile" + curl --fail-with-body \ + -X PUT \ + --user "oauth2:${{ secrets.PACKAGE_REGISTRY_TOKEN }}" \ + --upload-file "$debfile" \ + "$urlBotball" + echo "final url: ${GITHUB_SERVER_URL}/${{ github.repository_owner }}/-/packages/debian/libcreate/${TAG}" + echo "final url for Botball: ${GITHUB_SERVER_URL}/Botball/-/packages/debian/libcreate/${TAG}" From ac3968e0551db9b7b1a47ab2230c084361db2c0a Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Fri, 6 Jun 2025 23:01:25 +0200 Subject: [PATCH 28/29] ci: package: fix whitespace errors Signed-off-by: Christoph Heiss --- .forgejo/workflows/package.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/package.yaml b/.forgejo/workflows/package.yaml index 2007e54..b090971 100644 --- a/.forgejo/workflows/package.yaml +++ b/.forgejo/workflows/package.yaml @@ -57,14 +57,14 @@ jobs: echo "api url: $url" debfile="_packages/libcreate_${TAG}_${{ matrix.platform.dpkg }}.deb" - + echo "uploading file: $debfile" curl --fail-with-body \ -X PUT \ --user "oauth2:${{ secrets.PACKAGE_REGISTRY_TOKEN }}" \ --upload-file "$debfile" \ "$url" - + echo "uploading file for WombatOs: $debfile" curl --fail-with-body \ -X PUT \ From d1071443ff183751d3a421b105712501270f5868 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Sun, 13 Apr 2025 14:01:07 -0700 Subject: [PATCH 29/29] Update Autonomy Lab link (cherry picked from commit 116be443e7970de1574b5dc5f91e414828854c08) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fa1232c..b1eb336 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ C++ library for interfacing with iRobot's Create 1 and 2 as well as most models - [`V_1`](https://drive.google.com/file/d/0B9O4b91VYXMdUHlqNklDU09NU0k/view?usp=sharing&resourcekey=0-KxMpRPBMsGAj7eSYC_9ewA) (Roomba 400 series ) - [`V_2`](https://drive.google.com/file/d/0B9O4b91VYXMdMmFPMVNDUEZ6d0U/view?usp=sharing&resourcekey=0-bqKH8xhtWdYtTik_LLWo9Q) (Create 1, Roomba 500 series) - [`V_3`](https://drive.google.com/file/d/0B9O4b91VYXMdSVk4amw1N09mQ3c/view?usp=sharing&resourcekey=0-rKvug2IzC7nj4zV31EJtww) (Create 2, Roomba 600-800 series) -* Author: [Jacob Perron](http://jacobperron.ca) ([Autonomy Lab](http://autonomylab.org), [Simon Fraser University](http://www.sfu.ca)) +* Author: [Jacob Perron](http://jacobperron.ca) ([Autonomy Lab](https://autonomy.cs.sfu.ca), [Simon Fraser University](http://www.sfu.ca)) * Contributors: [Mani Monajjemi](http:mani.im), [Ben Wolsieffer](https://github.com/lopsided98), [Josh Gadeken](https://github.com/process1183) ## Build Status ##