From 20a1cd07f6d14aba4cb9feb81598bbfbc0e524ed Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Wed, 31 Jul 2024 19:50:58 +0200 Subject: [PATCH 01/16] Update devcontainer to iron --- .devcontainer/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 46514cc..7f403ab 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ -FROM osrf/ros:humble-desktop -ARG ROS_DISTRO=humble +FROM osrf/ros:iron-desktop +ARG ROS_DISTRO=iron ARG USERNAME=ros ARG USER_UID=1000 ARG USER_GID=$USER_UID From 292c7da8737eb277e9e8e35a2f81fef5cfdc12dc Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Thu, 1 Aug 2024 20:40:54 +0200 Subject: [PATCH 02/16] Add ros iron workflows --- .github/workflows/build_and_test_iron.yaml | 25 +++++++++++++ .../workflows/{lint.yaml => lint_humble.yaml} | 0 .github/workflows/lint_iron.yaml | 36 +++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 .github/workflows/build_and_test_iron.yaml rename .github/workflows/{lint.yaml => lint_humble.yaml} (100%) create mode 100644 .github/workflows/lint_iron.yaml diff --git a/.github/workflows/build_and_test_iron.yaml b/.github/workflows/build_and_test_iron.yaml new file mode 100644 index 0000000..8442f75 --- /dev/null +++ b/.github/workflows/build_and_test_iron.yaml @@ -0,0 +1,25 @@ +--- +name: Build and Test (iron) + +on: + push: + branches: [iron] + + pull_request: + branches: [iron] + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:jammy + + steps: + - uses: ros-tooling/setup-ros@v0.7 + with: + use-ros2-testing: true + - uses: ros-tooling/action-ros-ci@v0.3 + with: + target-ros2-distro: iron diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint_humble.yaml similarity index 100% rename from .github/workflows/lint.yaml rename to .github/workflows/lint_humble.yaml diff --git a/.github/workflows/lint_iron.yaml b/.github/workflows/lint_iron.yaml new file mode 100644 index 0000000..f63be76 --- /dev/null +++ b/.github/workflows/lint_iron.yaml @@ -0,0 +1,36 @@ +--- +name: Lint +on: + pull_request: + push: + +jobs: + ament_lint_general: + name: ament_${{ matrix.linter }} + runs-on: ubuntu-latest + container: + image: rostooling/setup-ros-docker:ubuntu-jammy-ros-iron-ros-base-latest + strategy: + fail-fast: false + matrix: + linter: [xmllint, pep257] + steps: + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + linter: ${{ matrix.linter }} + distribution: iron + package-name: human_detector + ament_flake8: + name: ament_flake8 + runs-on: ubuntu-latest + container: + image: rostooling/setup-ros-docker:ubuntu-jammy-ros-iron-ros-base-latest + steps: + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + linter: flake8 + distribution: iron + package-name: human_detector + arguments: --config python_linter.flake8 From 81eedead980d2acc316230cff99bce574c538327 Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Thu, 1 Aug 2024 19:32:04 +0000 Subject: [PATCH 03/16] Remove cyclone from defualt RMW_IMPLEMENTATION in the dev container --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d69677f..27f3dde 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -27,7 +27,7 @@ "NVIDIA_DRIVER_CAPABILITIES": "all", "NVIDIA_VISIBLE_DEVICES": "all", "QT_X11_NO_MITSHM": "1", - "RMW_IMPLEMENTATION": "rmw_cyclonedds_cpp" + "RMW_IMPLEMENTATION": "" }, "customizations": { "vscode": { From 3211a75d62f038a9348717bdc1410e0b712e5095 Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Thu, 1 Aug 2024 19:33:34 +0000 Subject: [PATCH 04/16] Add iron build badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3ead86a..feff062 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Human Detector for ROS 2 ![humble](https://github.com/Wiktor-99/human_detector/actions/workflows/build_and_test_humble.yaml/badge.svg) +![iron](https://github.com/Wiktor-99/human_detector/actions/workflows/build_and_test_iron.yaml/badge.svg) This ROS 2 package utilizes MediaPipe and depth images to detect the position of a human in the x, y, and z coordinates. From 599fadab6359e9e31ab74e11a53a1da6d9c6eaf3 Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Mon, 5 Aug 2024 18:33:40 +0000 Subject: [PATCH 05/16] Add jazzy devcontainer --- .devcontainer/Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 7f403ab..bf32e37 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,11 +1,11 @@ -FROM osrf/ros:iron-desktop -ARG ROS_DISTRO=iron +FROM osrf/ros:jazzy-desktop +ARG ROS_DISTRO=jazzy ARG USERNAME=ros ARG USER_UID=1000 ARG USER_GID=$USER_UID ENV DEBIAN_FRONTEND=noninteractive -RUN groupadd --gid $USER_GID $USERNAME \ +RUN deluser ubuntu && groupadd --gid $USER_GID $USERNAME \ && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ && apt-get update \ && apt-get install -y sudo \ @@ -23,9 +23,8 @@ ENV DEBIAN_FRONTEND=noninteractive RUN sudo apt-get update --fix-missing \ && apt-get -y install bash-completion ros-$ROS_DISTRO-rmw-cyclonedds-cpp ros-$ROS_DISTRO-generate-parameter-library \ python3-pip pre-commit \ - && pip3 uninstall numpy \ - && pip3 install numpy==1.26.4 \ - && pip3 install mediapipe \ + && pip3 install numpy==1.26.4 --break-system-packages \ + && pip3 install mediapipe --break-system-packages\ && apt-get autoremove -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* From 63e89d3228ba11b7cc504833d3095a40a44a42a3 Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Mon, 5 Aug 2024 18:40:51 +0000 Subject: [PATCH 06/16] Add jazzy pipelinnes --- .github/workflows/build_and_test_jazzy.yaml | 55 +++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/build_and_test_jazzy.yaml diff --git a/.github/workflows/build_and_test_jazzy.yaml b/.github/workflows/build_and_test_jazzy.yaml new file mode 100644 index 0000000..3c61529 --- /dev/null +++ b/.github/workflows/build_and_test_jazzy.yaml @@ -0,0 +1,55 @@ +--- +name: Build and Test (jazzy) + +on: + push: + branches: [jazzy] + + pull_request: + branches: [jazzy] + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:noble + + steps: + - uses: ros-tooling/setup-ros@v0.7 + with: + use-ros2-testing: true + - uses: ros-tooling/action-ros-ci@v0.3 + with: + target-ros2-distro: jazzy + + ament_lint_general: + name: ament_${{ matrix.linter }} + runs-on: ubuntu-latest + container: + image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest + strategy: + fail-fast: false + matrix: + linter: [xmllint, pep257] + steps: + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + linter: ${{ matrix.linter }} + distribution: jazzy + package-name: human_detector + ament_flake8: + name: ament_flake8 + runs-on: ubuntu-latest + container: + image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest + steps: + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + linter: flake8 + distribution: jazzy + package-name: human_detector + arguments: --config python_linter.flake8 From e2c3c43f280b7a3296e811e29a47baa59c3bc0e0 Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Mon, 5 Aug 2024 18:49:00 +0000 Subject: [PATCH 07/16] Add jazzy badge --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index feff062..bf6d420 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Human Detector for ROS 2 -![humble](https://github.com/Wiktor-99/human_detector/actions/workflows/build_and_test_humble.yaml/badge.svg) +![jazzy](https://github.com/Wiktor-99/human_detector/actions/workflows/build_and_test_jazzy.yaml/badge.svg) ![iron](https://github.com/Wiktor-99/human_detector/actions/workflows/build_and_test_iron.yaml/badge.svg) +![humble](https://github.com/Wiktor-99/human_detector/actions/workflows/build_and_test_humble.yaml/badge.svg) This ROS 2 package utilizes MediaPipe and depth images to detect the position of a human in the x, y, and z coordinates. From 64094d8c96c190caf224b941e03127b07ec9d4f0 Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Tue, 6 Aug 2024 17:24:46 +0000 Subject: [PATCH 08/16] Update devcontainer to use rolling --- .devcontainer/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index bf32e37..f3b8ad2 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ -FROM osrf/ros:jazzy-desktop -ARG ROS_DISTRO=jazzy +FROM osrf/ros:rolling-desktop +ARG ROS_DISTRO=rolling ARG USERNAME=ros ARG USER_UID=1000 ARG USER_GID=$USER_UID From f1f9e6d98e86d4661ed224e158e25cb079bb1e9c Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Tue, 6 Aug 2024 17:25:43 +0000 Subject: [PATCH 09/16] Add workflow for rolling --- .github/workflows/build_and_test_rolling.yaml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/build_and_test_rolling.yaml diff --git a/.github/workflows/build_and_test_rolling.yaml b/.github/workflows/build_and_test_rolling.yaml new file mode 100644 index 0000000..b1a9ae5 --- /dev/null +++ b/.github/workflows/build_and_test_rolling.yaml @@ -0,0 +1,55 @@ +--- +name: Build and Test (rolling) + +on: + push: + branches: [rolling] + + pull_request: + branches: [rolling] + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:noble + + steps: + - uses: ros-tooling/setup-ros@v0.7 + with: + use-ros2-testing: true + - uses: ros-tooling/action-ros-ci@v0.3 + with: + target-ros2-distro: rolling + + ament_lint_general: + name: ament_${{ matrix.linter }} + runs-on: ubuntu-latest + container: + image: rostooling/setup-ros-docker:ubuntu-noble-ros-rolling-ros-base-latest + strategy: + fail-fast: false + matrix: + linter: [xmllint, pep257] + steps: + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + linter: ${{ matrix.linter }} + distribution: rolling + package-name: human_detector + ament_flake8: + name: ament_flake8 + runs-on: ubuntu-latest + container: + image: rostooling/setup-ros-docker:ubuntu-noble-ros-rolling-ros-base-latest + steps: + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + linter: flake8 + distribution: rolling + package-name: human_detector + arguments: --config python_linter.flake8 From 7de304729045ac2fc0774a3e9df82ec5e121826c Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Tue, 6 Aug 2024 19:31:35 +0200 Subject: [PATCH 10/16] Add badge for rolling --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index bf6d420..2a5fc4b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Human Detector for ROS 2 +![rolling](https://github.com/Wiktor-99/human_detector/actions/workflows/build_and_test_rolling.yaml/badge.svg) ![jazzy](https://github.com/Wiktor-99/human_detector/actions/workflows/build_and_test_jazzy.yaml/badge.svg) ![iron](https://github.com/Wiktor-99/human_detector/actions/workflows/build_and_test_iron.yaml/badge.svg) ![humble](https://github.com/Wiktor-99/human_detector/actions/workflows/build_and_test_humble.yaml/badge.svg) From c1c32796b18d29a091a2f51000b9ad27e8cdc93e Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Mon, 12 Aug 2024 18:25:30 +0200 Subject: [PATCH 11/16] Merge lint workflow as subjob of build and test workflows --- .github/workflows/build_and_test_humble.yaml | 29 ++++++++++++++++ .github/workflows/build_and_test_iron.yaml | 29 ++++++++++++++++ .github/workflows/lint_humble.yaml | 36 -------------------- .github/workflows/lint_iron.yaml | 36 -------------------- 4 files changed, 58 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/lint_humble.yaml delete mode 100644 .github/workflows/lint_iron.yaml diff --git a/.github/workflows/build_and_test_humble.yaml b/.github/workflows/build_and_test_humble.yaml index 567ad28..c4b0f48 100644 --- a/.github/workflows/build_and_test_humble.yaml +++ b/.github/workflows/build_and_test_humble.yaml @@ -23,3 +23,32 @@ jobs: - uses: ros-tooling/action-ros-ci@v0.3 with: target-ros2-distro: humble + ament_lint_general: + name: ament_${{ matrix.linter }} + runs-on: ubuntu-latest + container: + image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest + strategy: + fail-fast: false + matrix: + linter: [xmllint, pep257] + steps: + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + linter: ${{ matrix.linter }} + distribution: humble + package-name: human_detector + ament_flake8: + name: ament_flake8 + runs-on: ubuntu-latest + container: + image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest + steps: + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + linter: flake8 + distribution: humble + package-name: human_detector + arguments: --config python_linter.flake8 diff --git a/.github/workflows/build_and_test_iron.yaml b/.github/workflows/build_and_test_iron.yaml index 8442f75..1c0e514 100644 --- a/.github/workflows/build_and_test_iron.yaml +++ b/.github/workflows/build_and_test_iron.yaml @@ -23,3 +23,32 @@ jobs: - uses: ros-tooling/action-ros-ci@v0.3 with: target-ros2-distro: iron + ament_lint_general: + name: ament_${{ matrix.linter }} + runs-on: ubuntu-latest + container: + image: rostooling/setup-ros-docker:ubuntu-jammy-ros-iron-ros-base-latest + strategy: + fail-fast: false + matrix: + linter: [xmllint, pep257] + steps: + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + linter: ${{ matrix.linter }} + distribution: iron + package-name: human_detector + ament_flake8: + name: ament_flake8 + runs-on: ubuntu-latest + container: + image: rostooling/setup-ros-docker:ubuntu-jammy-ros-iron-ros-base-latest + steps: + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + linter: flake8 + distribution: iron + package-name: human_detector + arguments: --config python_linter.flake8 diff --git a/.github/workflows/lint_humble.yaml b/.github/workflows/lint_humble.yaml deleted file mode 100644 index 1a7bedc..0000000 --- a/.github/workflows/lint_humble.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: Lint -on: - pull_request: - push: - -jobs: - ament_lint_general: - name: ament_${{ matrix.linter }} - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest - strategy: - fail-fast: false - matrix: - linter: [xmllint, pep257] - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: ${{ matrix.linter }} - distribution: humble - package-name: human_detector - ament_flake8: - name: ament_flake8 - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: flake8 - distribution: humble - package-name: human_detector - arguments: --config python_linter.flake8 diff --git a/.github/workflows/lint_iron.yaml b/.github/workflows/lint_iron.yaml deleted file mode 100644 index f63be76..0000000 --- a/.github/workflows/lint_iron.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: Lint -on: - pull_request: - push: - -jobs: - ament_lint_general: - name: ament_${{ matrix.linter }} - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-jammy-ros-iron-ros-base-latest - strategy: - fail-fast: false - matrix: - linter: [xmllint, pep257] - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: ${{ matrix.linter }} - distribution: iron - package-name: human_detector - ament_flake8: - name: ament_flake8 - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-jammy-ros-iron-ros-base-latest - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: flake8 - distribution: iron - package-name: human_detector - arguments: --config python_linter.flake8 From 50d454d1028216feb59e4ed7f1667c0b58b1f370 Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Sat, 17 Aug 2024 11:47:58 +0200 Subject: [PATCH 12/16] Add one linter workflow for all branches --- .github/workflows/build_and_test_humble.yaml | 29 ------------ .github/workflows/build_and_test_iron.yaml | 29 ------------ .github/workflows/build_and_test_jazzy.yaml | 30 ------------- .github/workflows/build_and_test_rolling.yaml | 30 ------------- .github/workflows/linters.yaml | 44 +++++++++++++++++++ 5 files changed, 44 insertions(+), 118 deletions(-) create mode 100644 .github/workflows/linters.yaml diff --git a/.github/workflows/build_and_test_humble.yaml b/.github/workflows/build_and_test_humble.yaml index c4b0f48..567ad28 100644 --- a/.github/workflows/build_and_test_humble.yaml +++ b/.github/workflows/build_and_test_humble.yaml @@ -23,32 +23,3 @@ jobs: - uses: ros-tooling/action-ros-ci@v0.3 with: target-ros2-distro: humble - ament_lint_general: - name: ament_${{ matrix.linter }} - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest - strategy: - fail-fast: false - matrix: - linter: [xmllint, pep257] - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: ${{ matrix.linter }} - distribution: humble - package-name: human_detector - ament_flake8: - name: ament_flake8 - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: flake8 - distribution: humble - package-name: human_detector - arguments: --config python_linter.flake8 diff --git a/.github/workflows/build_and_test_iron.yaml b/.github/workflows/build_and_test_iron.yaml index 1c0e514..8442f75 100644 --- a/.github/workflows/build_and_test_iron.yaml +++ b/.github/workflows/build_and_test_iron.yaml @@ -23,32 +23,3 @@ jobs: - uses: ros-tooling/action-ros-ci@v0.3 with: target-ros2-distro: iron - ament_lint_general: - name: ament_${{ matrix.linter }} - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-jammy-ros-iron-ros-base-latest - strategy: - fail-fast: false - matrix: - linter: [xmllint, pep257] - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: ${{ matrix.linter }} - distribution: iron - package-name: human_detector - ament_flake8: - name: ament_flake8 - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-jammy-ros-iron-ros-base-latest - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: flake8 - distribution: iron - package-name: human_detector - arguments: --config python_linter.flake8 diff --git a/.github/workflows/build_and_test_jazzy.yaml b/.github/workflows/build_and_test_jazzy.yaml index 3c61529..5c85c12 100644 --- a/.github/workflows/build_and_test_jazzy.yaml +++ b/.github/workflows/build_and_test_jazzy.yaml @@ -23,33 +23,3 @@ jobs: - uses: ros-tooling/action-ros-ci@v0.3 with: target-ros2-distro: jazzy - - ament_lint_general: - name: ament_${{ matrix.linter }} - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest - strategy: - fail-fast: false - matrix: - linter: [xmllint, pep257] - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: ${{ matrix.linter }} - distribution: jazzy - package-name: human_detector - ament_flake8: - name: ament_flake8 - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: flake8 - distribution: jazzy - package-name: human_detector - arguments: --config python_linter.flake8 diff --git a/.github/workflows/build_and_test_rolling.yaml b/.github/workflows/build_and_test_rolling.yaml index b1a9ae5..d099217 100644 --- a/.github/workflows/build_and_test_rolling.yaml +++ b/.github/workflows/build_and_test_rolling.yaml @@ -23,33 +23,3 @@ jobs: - uses: ros-tooling/action-ros-ci@v0.3 with: target-ros2-distro: rolling - - ament_lint_general: - name: ament_${{ matrix.linter }} - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-noble-ros-rolling-ros-base-latest - strategy: - fail-fast: false - matrix: - linter: [xmllint, pep257] - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: ${{ matrix.linter }} - distribution: rolling - package-name: human_detector - ament_flake8: - name: ament_flake8 - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-noble-ros-rolling-ros-base-latest - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: flake8 - distribution: rolling - package-name: human_detector - arguments: --config python_linter.flake8 diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml new file mode 100644 index 0000000..58b2501 --- /dev/null +++ b/.github/workflows/linters.yaml @@ -0,0 +1,44 @@ +--- +name: ROS + +on: + pull_request: + push: + branches: + - foxy* + - humble* + - iron* + - rolling* + - main* + workflow_dispatch: + +jobs: + ament_lint_general: + name: ament_${{ matrix.linter }} + runs-on: ubuntu-latest + container: + image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest + strategy: + fail-fast: false + matrix: + linter: [xmllint, pep257] + steps: + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + linter: ${{ matrix.linter }} + distribution: humble + package-name: human_detector + ament_flake8: + name: ament_flake8 + runs-on: ubuntu-latest + container: + image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest + steps: + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + linter: flake8 + distribution: humble + package-name: human_detector + arguments: --config python_linter.flake8 From a7cc05266f78770b9a619c240daa7f9f8bded111 Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Sat, 24 Aug 2024 21:11:22 +0200 Subject: [PATCH 13/16] CI refactor --- .github/actions/lint/action.yaml | 7 +++++++ .github/actions/lint/run.sh | 10 ++++++++++ .github/workflows/linters.yaml | 29 +++++++---------------------- 3 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 .github/actions/lint/action.yaml create mode 100644 .github/actions/lint/run.sh diff --git a/.github/actions/lint/action.yaml b/.github/actions/lint/action.yaml new file mode 100644 index 0000000..c7db400 --- /dev/null +++ b/.github/actions/lint/action.yaml @@ -0,0 +1,7 @@ +--- +name: Lint +description: Lint using devcontainer +runs: + using: docker + image: ../../../.devcontainer/Dockerfile + entrypoint: .github/actions/lint/run.sh diff --git a/.github/actions/lint/run.sh b/.github/actions/lint/run.sh new file mode 100644 index 0000000..94e8f0c --- /dev/null +++ b/.github/actions/lint/run.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +sudo apt-get update +source /opt/ros/$ROS_DISTRO/setup.bash +if [[ "ament_flake8" == "ament_${LINTER}" ]]; then + ament_${LINTER} . --config python_linter.flake8 +else + ament_${LINTER} +fi diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml index 58b2501..f70e3c5 100644 --- a/.github/workflows/linters.yaml +++ b/.github/workflows/linters.yaml @@ -16,29 +16,14 @@ jobs: ament_lint_general: name: ament_${{ matrix.linter }} runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest strategy: fail-fast: false matrix: - linter: [xmllint, pep257] + linter: [xmllint, flake8, pep257] steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: ${{ matrix.linter }} - distribution: humble - package-name: human_detector - ament_flake8: - name: ament_flake8 - runs-on: ubuntu-latest - container: - image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - linter: flake8 - distribution: humble - package-name: human_detector - arguments: --config python_linter.flake8 + - name: Checkout code + uses: actions/checkout@v4 + - name: Run linter + uses: ./.github/actions/lint/ + env: + LINTER: ${{ matrix.linter }} From 5a9e8778ec83fc8c6cb05dc9bda9f526b7f456e8 Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Sun, 25 Aug 2024 12:16:14 +0200 Subject: [PATCH 14/16] Update linter script permission --- .github/actions/lint/run.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/actions/lint/run.sh diff --git a/.github/actions/lint/run.sh b/.github/actions/lint/run.sh old mode 100644 new mode 100755 From 6ab34318b023ba2c3ddefd2bb4a575f1f55276d8 Mon Sep 17 00:00:00 2001 From: Wiktor Bajor <69388767+Wiktor-99@users.noreply.github.com> Date: Wed, 28 Aug 2024 18:48:33 +0200 Subject: [PATCH 15/16] Update Dockerfile --- .devcontainer/Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f3b8ad2..7f403ab 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,11 +1,11 @@ -FROM osrf/ros:rolling-desktop -ARG ROS_DISTRO=rolling +FROM osrf/ros:iron-desktop +ARG ROS_DISTRO=iron ARG USERNAME=ros ARG USER_UID=1000 ARG USER_GID=$USER_UID ENV DEBIAN_FRONTEND=noninteractive -RUN deluser ubuntu && groupadd --gid $USER_GID $USERNAME \ +RUN groupadd --gid $USER_GID $USERNAME \ && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ && apt-get update \ && apt-get install -y sudo \ @@ -23,8 +23,9 @@ ENV DEBIAN_FRONTEND=noninteractive RUN sudo apt-get update --fix-missing \ && apt-get -y install bash-completion ros-$ROS_DISTRO-rmw-cyclonedds-cpp ros-$ROS_DISTRO-generate-parameter-library \ python3-pip pre-commit \ - && pip3 install numpy==1.26.4 --break-system-packages \ - && pip3 install mediapipe --break-system-packages\ + && pip3 uninstall numpy \ + && pip3 install numpy==1.26.4 \ + && pip3 install mediapipe \ && apt-get autoremove -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* From 47618edeb7b59c9dbb986ea40c8dd482eaf977e4 Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Thu, 29 Aug 2024 16:17:02 +0200 Subject: [PATCH 16/16] Revert changes from iron --- .devcontainer/Dockerfile | 4 ++-- .devcontainer/devcontainer.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 7f403ab..46514cc 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ -FROM osrf/ros:iron-desktop -ARG ROS_DISTRO=iron +FROM osrf/ros:humble-desktop +ARG ROS_DISTRO=humble ARG USERNAME=ros ARG USER_UID=1000 ARG USER_GID=$USER_UID diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 27f3dde..d69677f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -27,7 +27,7 @@ "NVIDIA_DRIVER_CAPABILITIES": "all", "NVIDIA_VISIBLE_DEVICES": "all", "QT_X11_NO_MITSHM": "1", - "RMW_IMPLEMENTATION": "" + "RMW_IMPLEMENTATION": "rmw_cyclonedds_cpp" }, "customizations": { "vscode": {