From c6c5434ef927f0f997601a7966a8f771ee67045c Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Wed, 27 Sep 2023 12:55:03 +0200 Subject: [PATCH 1/4] ci: change test workflow to docker build --- .../build-test-humble-devel/action.yml | 6 --- .github/actions/build-test-humble/action.yml | 6 --- .github/common/build-test.sh | 35 --------------- .github/common/entrypoint.sh | 3 -- .github/workflows/build-test.yml | 43 ++++++------------- 5 files changed, 12 insertions(+), 81 deletions(-) delete mode 100644 .github/actions/build-test-humble-devel/action.yml delete mode 100644 .github/actions/build-test-humble/action.yml delete mode 100755 .github/common/build-test.sh delete mode 100755 .github/common/entrypoint.sh diff --git a/.github/actions/build-test-humble-devel/action.yml b/.github/actions/build-test-humble-devel/action.yml deleted file mode 100644 index 25181c7e..00000000 --- a/.github/actions/build-test-humble-devel/action.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: 'Build and Test (humble-devel)' -description: 'Build the source packages and run all unit tests' -runs: - using: 'docker' - image: 'ghcr.io/aica-technology/ros2-control-libraries:humble-devel' - entrypoint: '/github/workspace/.github/common/entrypoint.sh' diff --git a/.github/actions/build-test-humble/action.yml b/.github/actions/build-test-humble/action.yml deleted file mode 100644 index dd9a9191..00000000 --- a/.github/actions/build-test-humble/action.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: 'Build and Test (humble)' -description: 'Build the source packages and run all unit tests' -runs: - using: 'docker' - image: 'ghcr.io/aica-technology/ros2-control-libraries:humble' - entrypoint: '/github/workspace/.github/common/entrypoint.sh' diff --git a/.github/common/build-test.sh b/.github/common/build-test.sh deleted file mode 100755 index 13d7d786..00000000 --- a/.github/common/build-test.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -STEP=1 -build_and_test() { - PACKAGE=$1 - - echo ">>> ${STEP}: Building ${PACKAGE}..." - cp -r /github/workspace/source/"${PACKAGE}" ./src/"${PACKAGE}" - if ! colcon build --packages-select "${PACKAGE}"; then - echo ">>> [ERROR] Build stage ${STEP} failed!" - exit "${STEP}" - fi - echo ">>> Build stage ${STEP} completed successfully!" - STEP=$((STEP+1)) - - echo ">>> ${STEP}: Testing ${PACKAGE}..." - if ! colcon test --packages-select "${PACKAGE}" --return-code-on-test-failure; then - colcon test-result --verbose - echo ">>> [ERROR] Test stage ${STEP} failed!" - exit "${STEP}" - fi - echo ">>> Test stage ${STEP} completed successfully!" - STEP=$((STEP+1)) -} - -source /opt/ros/"${ROS_DISTRO}"/setup.bash -cd /home/ros2/ros2_ws - -build_and_test modulo_component_interfaces -build_and_test modulo_utils -build_and_test modulo_core -build_and_test modulo_components - -echo ">>> All build and test stages completed successfully!" -exit 0 diff --git a/.github/common/entrypoint.sh b/.github/common/entrypoint.sh deleted file mode 100755 index a2d20c18..00000000 --- a/.github/common/entrypoint.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -sudo su - ros2 -c /bin/bash -c /github/workspace/.github/common/build-test.sh diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index bf890ebb..73dfb5d5 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,40 +1,32 @@ name: Build and Test -# Run workflow on pushes to main and develop branches, on any pull request, or by manual dispatch on: - push: - branches: - - main - - develop pull_request: workflow_dispatch: -# Define the build test jobs jobs: - - check-contribution: + check: name: Check if changelog and version have been updated runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - - name: Check contributions + - name: Check changelog if: ${{ github.event.pull_request.base.sha }} run: | git fetch origin main ${{ github.event.pull_request.base.sha }} VER_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- ./VERSION) if ! [ "${VER_DIFF}" ]; then - echo "::warning title=Contribution check failed::VERSION must be updated!" + echo "::warning title=Version check failed::VERSION must be updated!" exit 1 fi CL_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- ./CHANGELOG.md) if ! [ "${CL_DIFF}" ]; then - echo "::warning title=Contribution check failed::CHANGELOG.md must be updated!" + echo "::warning title=CHEANGELOG check failed::CHANGELOG.md must be updated!" exit 1 fi shell: bash - # check if jobs can be skipped check-skippable-changes: name: Check skippable changes runs-on: ubuntu-latest @@ -49,28 +41,17 @@ jobs: paths_ignore: '["**.md"]' skip_after_successful_duplicate: 'true' - build-test-humble: + test: needs: check-skippable-changes if: ${{ needs.check-skippable-changes.outputs.skip != 'true' }} runs-on: ubuntu-latest - name: Humble build and test + name: Run tests steps: - # First check out the repository - - name: Checkout + - name: Checkout repository uses: actions/checkout@v3 - # Load the repository build-test action - - name: Build and Test - uses: ./.github/actions/build-test-humble - build-test-humble-devel: - needs: check-skippable-changes - if: ${{ needs.check-skippable-changes.outputs.skip != 'true' }} - runs-on: ubuntu-latest - name: Humble development build and test - steps: - # First check out the repository - - name: Checkout - uses: actions/checkout@v2 - # Load the repository build-test action - - name: Build and Test - uses: ./.github/actions/build-test-humble-devel \ No newline at end of file + - name: Test + run: | + DOCKER_BUILDKIT=1 docker build --target test . + shell: bash + \ No newline at end of file From a0c2ae21c8a75cd7a37476bc3569926336e7e4b1 Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Wed, 27 Sep 2023 12:55:12 +0200 Subject: [PATCH 2/4] 3.0.4 -> 3.0.5 --- VERSION | 2 +- doxygen/doxygen.conf | 2 +- source/modulo_component_interfaces/package.xml | 2 +- source/modulo_components/package.xml | 2 +- source/modulo_core/package.xml | 2 +- source/modulo_utils/package.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index b0f2dcb3..eca690e7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.4 +3.0.5 diff --git a/doxygen/doxygen.conf b/doxygen/doxygen.conf index 722b3862..d01f9adb 100644 --- a/doxygen/doxygen.conf +++ b/doxygen/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "Modulo" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 3.0.4 +PROJECT_NUMBER = 3.0.5 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/source/modulo_component_interfaces/package.xml b/source/modulo_component_interfaces/package.xml index b7b6b8c2..2d229964 100644 --- a/source/modulo_component_interfaces/package.xml +++ b/source/modulo_component_interfaces/package.xml @@ -2,7 +2,7 @@ modulo_component_interfaces - 3.0.4 + 3.0.5 Interface package for communicating with modulo components through the ROS framework Enrico Eberhard GPLv3 diff --git a/source/modulo_components/package.xml b/source/modulo_components/package.xml index d51e6cd8..b902a3dc 100644 --- a/source/modulo_components/package.xml +++ b/source/modulo_components/package.xml @@ -2,7 +2,7 @@ modulo_components - 3.0.4 + 3.0.5 Modulo base classes that wrap ROS2 Nodes as modular components for the AICA application framework Baptiste Busch Enrico Eberhard diff --git a/source/modulo_core/package.xml b/source/modulo_core/package.xml index c99f789c..a5bf8820 100644 --- a/source/modulo_core/package.xml +++ b/source/modulo_core/package.xml @@ -2,7 +2,7 @@ modulo_core - 3.0.4 + 3.0.5 Modulo Core communication and translation utilities for interoperability with AICA Control Libraries Baptiste Busch Enrico Eberhard diff --git a/source/modulo_utils/package.xml b/source/modulo_utils/package.xml index 800e55b3..16f9fa52 100644 --- a/source/modulo_utils/package.xml +++ b/source/modulo_utils/package.xml @@ -2,7 +2,7 @@ modulo_utils - 3.0.4 + 3.0.5 Modulo utils package for shared test fixtures Dominic Reber GPLv3 From f28ec2cbd45a571a380c3cb4c0830c81525dd4ed Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Wed, 27 Sep 2023 12:57:51 +0200 Subject: [PATCH 3/4] docs: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24c7a784..76896207 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Release Versions: - build: unify dockerfiles and add vs code configuration (#50) - feat: add on_step_callback for component (#51) - build: use iron as ros2 distro (#53) +- ci: change test workflow to docker build (#55) ## 3.0.0 From 614299f123606ca419fb3d9e0952e44b19054af0 Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Wed, 27 Sep 2023 13:05:25 +0200 Subject: [PATCH 4/4] fix: remove condition --- .github/workflows/build-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 73dfb5d5..73953132 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -12,7 +12,6 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Check changelog - if: ${{ github.event.pull_request.base.sha }} run: | git fetch origin main ${{ github.event.pull_request.base.sha }} VER_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- ./VERSION)