From 3da9a206064c20e6f6e977409a13197e7d085ad4 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Mon, 13 Nov 2023 10:18:31 -0600 Subject: [PATCH 1/5] Update Github Action workflows (#119) * Update github action workflows * Use on only on stable branches to avoid duplicate runs * Update project automation --------- Signed-off-by: Addisu Z. Taddese --- .github/workflows/ci.yml | 14 ++++++++++---- .github/workflows/triage.yml | 9 +++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 997fabe..0568d55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,12 @@ name: Ubuntu CI -on: [push, pull_request] +on: + pull_request: + push: + branches: + - 'ign-utils[0-9]' + - 'gz-utils[0-9]' + - 'main' jobs: bionic-ci: @@ -8,7 +14,7 @@ jobs: name: Ubuntu Bionic CI steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Compile and test id: ci uses: ignition-tooling/action-ignition-ci@bionic @@ -19,7 +25,7 @@ jobs: name: Ubuntu Focal CI steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Compile and test id: ci uses: ignition-tooling/action-ignition-ci@focal @@ -31,7 +37,7 @@ jobs: name: Ubuntu Jammy CI steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Compile and test id: ci uses: ignition-tooling/action-ignition-ci@jammy diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 736670e..2332244 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -10,10 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Add ticket to inbox - uses: technote-space/create-project-card-action@v1 + uses: actions/add-to-project@v0.5.0 with: - PROJECT: Core development - COLUMN: Inbox - GITHUB_TOKEN: ${{ secrets.TRIAGE_TOKEN }} - CHECK_ORG_PROJECT: true - + project-url: https://github.com/orgs/gazebosim/projects/7 + github-token: ${{ secrets.TRIAGE_TOKEN }} From a6c9465d5be0638d877232a4a53ad524afdb03a2 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Thu, 21 Dec 2023 06:34:09 -0800 Subject: [PATCH 2/5] Update CI badges in README (#120) Signed-off-by: Ian Chen --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 09c724f..c4a2c9c 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ Build | Status -- | -- -Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-utils/branch/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-utils) -Ubuntu Focal | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_utils-ci-main-focal-amd64)](https://build.osrfoundation.org/job/ignition_utils-ci-main-focal-amd64) -Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_utils-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/ignition_utils-ci-main-homebrew-amd64) -Windows | [![Build Status](https://build.osrfoundation.org/job/ign_utils-ci-win/badge/icon)](https://build.osrfoundation.org/job/ign_utils-ci-win/) +Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-utils/tree/gz-utils2/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-utils/tree/gz-utils2) +Ubuntu Jammy | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_utils-ci-gz-utils2-jammy-amd64)](https://build.osrfoundation.org/job/gz_utils-ci-gz-utils2-jammy-amd64) +Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_utils-ci-gz-utils2-homebrew-amd64)](https://build.osrfoundation.org/job/gz_utils-ci-gz-utils2-homebrew-amd64) +Windows | [![Build Status](https://build.osrfoundation.org/job/gz_utils-2-win/badge/icon)](https://build.osrfoundation.org/job/gz_utils-2-win/) Gazebo Utils, a component of [Gazebo](https://gazebosim.org), provides general purpose classes and functions designed for robotic applications. From 56b4f131c4bc89452e9a7ce6472a822a467ffda0 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 5 Feb 2024 15:38:36 -0600 Subject: [PATCH 3/5] Lint (#124) Signed-off-by: Michael Carroll --- include/gz/utils/detail/subprocess.h | 4 ++-- src/Environment.cc | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/gz/utils/detail/subprocess.h b/include/gz/utils/detail/subprocess.h index 7077ffe..137aa14 100644 --- a/include/gz/utils/detail/subprocess.h +++ b/include/gz/utils/detail/subprocess.h @@ -187,7 +187,7 @@ subprocess_weak int subprocess_terminate(struct subprocess_s *const process); /// /// The only safe way to read from the standard output of a process during it's /// execution is to use the `subprocess_option_enable_async` option in -/// conjuction with this method. +/// conjunction with this method. subprocess_weak unsigned subprocess_read_stdout(struct subprocess_s *const process, char *const buffer, unsigned size); @@ -201,7 +201,7 @@ subprocess_read_stdout(struct subprocess_s *const process, char *const buffer, /// /// The only safe way to read from the standard error of a process during it's /// execution is to use the `subprocess_option_enable_async` option in -/// conjuction with this method. +/// conjunction with this method. subprocess_weak unsigned subprocess_read_stderr(struct subprocess_s *const process, char *const buffer, unsigned size); diff --git a/src/Environment.cc b/src/Environment.cc index d477414..7daace5 100644 --- a/src/Environment.cc +++ b/src/Environment.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include #ifdef _WIN32 @@ -189,7 +190,9 @@ EnvironmentStrings envMapToStrings(const EnvironmentMap &_envMap) std::sort(sorted.begin(), sorted.end()); for (auto [key, value] : sorted) { - ret.push_back(key + "=" + value); + key += '='; + key += value; + ret.push_back(key); } return ret; } From f9281920e64f597750dd88b73e194cb982d8fd40 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 6 Feb 2024 16:24:55 -0600 Subject: [PATCH 4/5] bazel: build and test subprocess functionality (#123) Signed-off-by: Michael Carroll --- BUILD.bazel | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/BUILD.bazel b/BUILD.bazel index cafd9c2..435829a 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -41,6 +41,7 @@ gz_export_header( public_headers_no_gen = glob([ "include/gz/utils/*.hh", "include/gz/utils/detail/*.hh", + "include/gz/utils/detail/*.h", ]) gz_include_header( @@ -110,3 +111,23 @@ cc_test( "@gtest//:gtest_main", ], ) + +cc_binary( + name = "subprocess_main", + srcs = ["test/integration/subprocess/subprocess_main.cc"], + deps = [ + GZ_ROOT + "utils/cli", + ] +) + +cc_test( + name = "subprocess_TEST", + srcs = ["test/integration/subprocess_TEST.cc"], + deps = [ + ":utils", + ":subprocess_main", + "@gtest", + "@gtest//:gtest_main", + ], + local_defines = ['SUBPROCESS_EXECUTABLE_PATH=\\"utils/subprocess_main\\"'], +) From fd618d23156f754726fcd641934d908c766c8f75 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Wed, 17 Apr 2024 15:16:26 -0500 Subject: [PATCH 5/5] Add package.xml (#125) Signed-off-by: Addisu Z. Taddese --- package.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 package.xml diff --git a/package.xml b/package.xml new file mode 100644 index 0000000..6025b62 --- /dev/null +++ b/package.xml @@ -0,0 +1,19 @@ + + + gz-utils2 + 2.2.0 + Gazebo Utils : Classes and functions for robot applications + + Addizu Z. Taddese + Apache License 2.0 + + https://github.com/gazebosim/gz-utils + + cmake + + gz-cmake3 + + + cmake + +