From 2a84136355a31774130344b71b09d91eee907d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20=C5=A0togl?= Date: Wed, 23 Mar 2022 18:19:18 +0100 Subject: [PATCH] Update CI generation scripts and configurations. (#30) --- .../ros_packages/configure_repository.rst | 22 +++- scripts/_Team_Defines.bash | 10 ++ ...i-config.bash => setup-repository-ci.bash} | 13 +++ templates/package/.pre-commit-config.yaml | 8 +- .../package/CI-github_abi-compatibility.yml | 17 +++ templates/package/CI-github_binary-build.yml | 54 ++------- .../package/CI-github_ci-build-coverage.yml | 41 ------- .../package/CI-github_ci-build-source.yml | 32 ------ templates/package/CI-github_ci-build.yml | 72 ------------ .../package/CI-github_ci-coverage-build.yml | 3 +- .../package/CI-github_ci-format-private.yml | 4 +- templates/package/CI-github_ci-format.yml | 7 +- templates/package/CI-github_ci-ros-lint.yml | 6 +- .../package/CI-github_prerelease-check.yml | 39 +++++++ ...thub_reusable-industrial-ci-with-cache.yml | 106 ++++++++++++++++++ .../package/CI-github_rhel-binary-build.yml | 30 +++++ .../package/CI-github_semi-binary-build.yml | 53 ++------- templates/package/CI-github_source-build.yml | 34 ++---- ...ET_USED-Config-github_bots_behaviorbot.yml | 21 ++++ ...OT_YET_USED-Config-github_bots_mergify.yml | 26 +++++ ...T_USED_CI-github_ci-doxygen-deployment.yml | 29 +++++ .../package/_append_to_README_ROS_Intro.md | 2 +- 22 files changed, 351 insertions(+), 278 deletions(-) rename scripts/{setup-ci-config.bash => setup-repository-ci.bash} (93%) create mode 100644 templates/package/CI-github_abi-compatibility.yml delete mode 100644 templates/package/CI-github_ci-build-coverage.yml delete mode 100644 templates/package/CI-github_ci-build-source.yml delete mode 100644 templates/package/CI-github_ci-build.yml create mode 100644 templates/package/CI-github_prerelease-check.yml create mode 100644 templates/package/CI-github_reusable-industrial-ci-with-cache.yml create mode 100644 templates/package/CI-github_rhel-binary-build.yml create mode 100644 templates/package/_NOT_YET_USED-Config-github_bots_behaviorbot.yml create mode 100644 templates/package/_NOT_YET_USED-Config-github_bots_mergify.yml create mode 100644 templates/package/_NOT_YET_USED_CI-github_ci-doxygen-deployment.yml diff --git a/docs/use-cases/ros_packages/configure_repository.rst b/docs/use-cases/ros_packages/configure_repository.rst index e0791f07..e8d61519 100644 --- a/docs/use-cases/ros_packages/configure_repository.rst +++ b/docs/use-cases/ros_packages/configure_repository.rst @@ -3,4 +3,24 @@ Configure Repository ===================== .. _uc-configure-repo: -To be documented... +Setup Repository CI configuration (GitHub) +=========================================== + +``setup-repository-ci`` script is used, accepting the package name and description as parameters. +The script **has to be executed** from the *main* folder of your package. + +.. code-block:: bash + :caption: Usage of script for setting up new packages. + :name: setup-package-ci + + setup-repository-ci "repo_name" "repo_namespace" ["first_package" "second_package" ...] + +When executing the script, read all output carefully. +If you make any wrong decision or enter incorrect data, use +C keys to terminate the script. + +The script can add setup for multiple ROS2 versions. +Simply follow the output. + +After a setup is created, you should go through the files and check if they are correct. +Then try to push this to a GitHub-repository and open a PR. +You should then already see new workflows active. diff --git a/scripts/_Team_Defines.bash b/scripts/_Team_Defines.bash index 88a678d6..6e5a6fc0 100644 --- a/scripts/_Team_Defines.bash +++ b/scripts/_Team_Defines.bash @@ -79,4 +79,14 @@ alias setup-robot-description=$RosTeamWS_FRAMEWORK_SCRIPTS_PATH/setup-robot-desc alias ros2_control_setup-hardware-interface-package=$RosTeamWS_FRAMEWORK_SCRIPTS_PATH/ros2_control/setup-hardware-interface-package.bash alias ros2_control_setup-controller-package=$RosTeamWS_FRAMEWORK_SCRIPTS_PATH/ros2_control/setup-controller-package.bash +# Team General aliases and functions +function generate_gif_from_video { + + if [ -z "$1" ]; then + print_and_exit "File name has to be defined!" + fi + + ffmpeg -i $1 -filter_complex "[0:v] fps=12,scale=w=960:h=-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" $1.gif +} + # END Define aliases for standard functions diff --git a/scripts/setup-ci-config.bash b/scripts/setup-repository-ci.bash similarity index 93% rename from scripts/setup-ci-config.bash rename to scripts/setup-repository-ci.bash index 50f8d678..7b161bcc 100755 --- a/scripts/setup-ci-config.bash +++ b/scripts/setup-repository-ci.bash @@ -47,23 +47,36 @@ if [[ "$choice" == "yes" ]]; then CI_FORMAT="ci-format-private" fi +# File-suffix definitions CI_ROS_LINT="ci-ros-lint" CI_COVERAGE="ci-coverage-build" +CI_REUSABLE_INDUSTRIAL_CI="reusable-industrial-ci-with-cache" +CI_REUSABLE_ROS_TOOLING="reusable-ros-tooling-source-build" +PRE_RELEASE="prerelease-check" + +CI_ABI_COMPATIBILITY="abi-compatibility" CI_BINARY_BUILD="binary-build" CI_SEMI_BINARY_BUILD="semi-binary-build" CI_SOURCE_BUILD="source-build" +CI_RHEL_BINARY_BUILD="rhel-binary-build" +# Lists for different generation stages CI_GENERAL_FILES=( $CI_FORMAT $CI_ROS_LINT $CI_COVERAGE + $CI_REUSABLE_INDUSTRIAL_CI + $CI_REUSABLE_ROS_TOOLING + $PRE_RELEASE ) CI_DISTRIBUTION_FILES=( + $CI_ABI_COMPATIBILITY $CI_BINARY_BUILD $CI_SEMI_BINARY_BUILD $CI_SOURCE_BUILD + $CI_RHEL_BINARY_BUILD ) read -p "${RAW_TERMINAL_COLOR_BROWN}Name of the default ROS distro?${RAW_TERMINAL_COLOR_NC} [default: rolling] " default_ros_distro diff --git a/templates/package/.pre-commit-config.yaml b/templates/package/.pre-commit-config.yaml index 932ec2f2..d7cf2daf 100644 --- a/templates/package/.pre-commit-config.yaml +++ b/templates/package/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: # Standard hooks - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.1.0 hooks: - id: check-added-large-files - id: check-ast @@ -33,13 +33,13 @@ repos: # Python hooks - repo: https://github.com/asottile/pyupgrade - rev: v2.29.0 + rev: v2.31.0 hooks: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/psf/black - rev: 21.10b0 + rev: 21.12b0 hooks: - id: black args: ["--line-length=99"] @@ -119,7 +119,7 @@ repos: # Docs - RestructuredText hooks - repo: https://github.com/PyCQA/doc8 - rev: 0.9.1 + rev: 0.10.1 hooks: - id: doc8 args: ['--max-line-length=100', '--ignore=D001'] diff --git a/templates/package/CI-github_abi-compatibility.yml b/templates/package/CI-github_abi-compatibility.yml new file mode 100644 index 00000000..f6c53d8a --- /dev/null +++ b/templates/package/CI-github_abi-compatibility.yml @@ -0,0 +1,17 @@ +name: ABI Compatibility Check +on: + pull_request: + branches: + - $branch$ + +jobs: + abi_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ros-industrial/industrial_ci@master + env: + ROS_DISTRO: $ROS_DISTRO$ + ROS_REPO: main + ABICHECK_URL: github:${{ github.repository }}#${{ github.base_ref }} + NOT_TEST_BUILD: true diff --git a/templates/package/CI-github_binary-build.yml b/templates/package/CI-github_binary-build.yml index f56af677..5210ca55 100644 --- a/templates/package/CI-github_binary-build.yml +++ b/templates/package/CI-github_binary-build.yml @@ -1,4 +1,7 @@ name: $Ros_distro$ Binary Build +# author: Denis Štogl +# description: 'Build & test all dependencies from released (binary) packages.' + on: pull_request: branches: @@ -8,49 +11,12 @@ on: - $branch$ schedule: # Run every morning to detect flakiness and broken dependencies - - cron: '13 4 * * *' + - cron: '03 1 * * *' jobs: - $ROS_DISTRO$_binary: - name: $ROS_DISTRO$ binary build - runs-on: ubuntu-latest - strategy: - matrix: - env: - - {ROS_DISTRO: $ROS_DISTRO$, ROS_REPO: main} - - {ROS_DISTRO: $ROS_DISTRO$, ROS_REPO: testing} - env: - UPSTREAM_WORKSPACE: $NAME$-not-released.${{ matrix.env.ROS_DISTRO }}.repos - CCACHE_DIR: ${{ github.workspace }}/.ccache - BASEDIR: ${{ github.workspace }}/.work - CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} - steps: - - uses: actions/checkout@v1 - # The target directory cache doesn't include the source directory because - # that comes from the checkout. See "prepare target_ws for cache" task below - - name: cache target_ws - if: ${{ ! matrix.env.CCOV }} - uses: pat-s/always-upload-cache@v2.1.5 - with: - path: ${{ env.BASEDIR }}/target_ws - key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} - restore-keys: | - target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} - - name: cache ccache - uses: pat-s/always-upload-cache@v2.1.5 - with: - path: ${{ env.CCACHE_DIR }} - key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} - restore-keys: | - ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} - ccache-${{ env.CACHE_PREFIX }} - - uses: 'ros-industrial/industrial_ci@master' - with: - config: ${{toJSON(matrix.env)}} - - name: prepare target_ws for cache - if: ${{ always() && ! matrix.env.CCOV }} - run: | - du -sh ${{ env.BASEDIR }}/target_ws - sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete - sudo rm -rf ${{ env.BASEDIR }}/target_ws/src - du -sh ${{ env.BASEDIR }}/target_ws + binary: + uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + with: + ros_distro: $ROS_DISTRO$ + upstream_workspace: $NAME$-not-released.$ROS_DISTRO$.repos + ref_for_scheduled_build: $branch$ diff --git a/templates/package/CI-github_ci-build-coverage.yml b/templates/package/CI-github_ci-build-coverage.yml deleted file mode 100644 index 37a0331d..00000000 --- a/templates/package/CI-github_ci-build-coverage.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Build Source -on: - push: - branches: - - $ROS_DISTRO$ - schedule: - # Run every day to detect flakiness and broken dependencies - - cron: '28 3 * * *' - -jobs: - source: - name: source build - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - steps: - - uses: ros-tooling/setup-ros@0.0.26 - - uses: ros-tooling/action-ros-ci@0.2 - with: - target-ros2-distro: $ROS_DISTRO$ - # build all packages listed in the meta package - package-name: - $NAME$ - vcs-repo-file-url: | - https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/$NAME$.repos - colcon-defaults: | - { - "build": { - "mixin": ["coverage-gcc"] - } - } - colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml - - uses: codecov/codecov-action@v1.0.14 - with: - file: ros_ws/lcov/total_coverage.info - flags: unittests - name: codecov-umbrella - - uses: actions/upload-artifact@v1 - with: - name: colcon-logs-${{ matrix.os }} - path: ros_ws/log diff --git a/templates/package/CI-github_ci-build-source.yml b/templates/package/CI-github_ci-build-source.yml deleted file mode 100644 index 1042c958..00000000 --- a/templates/package/CI-github_ci-build-source.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Build Source -on: - pull_request: - push: - branches: - - $ROS_DISTRO$ - schedule: - # Run every day to detect flakiness and broken dependencies - - cron: '28 3 * * *' - -jobs: - source: - name: source build - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - steps: - - uses: ros-tooling/setup-ros@0.0.26 - - uses: ros-tooling/action-ros-ci@0.2 - with: - target-ros2-distro: $ROS_DISTRO$ - # build all packages listed in the meta package - package-name: - $NAME$ - vcs-repo-file-url: | - https://raw.githubusercontent.com/ros2/ros2/$ROS_DISTRO$/ros2.repos - https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/$NAME$.repos - colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml - - uses: actions/upload-artifact@v1 - with: - name: colcon-logs-${{ matrix.os }} - path: ros_ws/log diff --git a/templates/package/CI-github_ci-build.yml b/templates/package/CI-github_ci-build.yml deleted file mode 100644 index 35ab5dfa..00000000 --- a/templates/package/CI-github_ci-build.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Build -on: - pull_request: - push: - branches: - - $ROS_DISTRO$ - schedule: - # Run every day to detect flakiness and broken dependencies - - cron: '28 6 * * *' - -jobs: - binary-build: - name: binary build - runs-on: ubuntu-latest - strategy: - matrix: - env: - - {ROS_DISTRO: $ROS_DISTRO$, ROS_REPO: main} - - {ROS_DISTRO: $ROS_DISTRO$, ROS_REPO: testing} - env: - UPSTREAM_WORKSPACE: $NAME$.repos - steps: - - uses: actions/checkout@v1 - - uses: 'ros-industrial/industrial_ci@master' - env: ${{matrix.env}} - - -## Build with cache -# ! NOT_TESTED... ! -# TODO: Test - binary-build-foxy: - name: binary build - runs-on: ubuntu-latest - strategy: - matrix: - env: - - {ROS_DISTRO: foxy, ROS_REPO: main} - - {ROS_DISTRO: foxy, ROS_REPO: testing} - env: - CCACHE_DIR: ${{ github.workspace }}/.ccache - BASEDIR: ${{ github.workspace }}/.work - CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} - UPSTREAM_WORKSPACE: repos.local.repos - steps: - - uses: actions/checkout@v1 - # The target directory cache doesn't include the source directory because - # that comes from the checkout. See "prepare target_ws for cache" task below - - name: cache target_ws - if: ${{ ! matrix.env.CCOV }} - uses: pat-s/always-upload-cache@v2.1.3 - with: - path: ${{ env.BASEDIR }}/target_ws - key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} - restore-keys: | - target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} - - name: cache ccache - uses: pat-s/always-upload-cache@v2.1.3 - with: - path: ${{ env.CCACHE_DIR }} - key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} - restore-keys: | - ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} - ccache-${{ env.CACHE_PREFIX }} - - uses: 'ros-industrial/industrial_ci@master' - env: ${{matrix.env}} - - name: prepare target_ws for cache - if: ${{ always() && ! matrix.env.CCOV }} - run: | - du -sh ${{ env.BASEDIR }}/target_ws - sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete - sudo rm -rf ${{ env.BASEDIR }}/target_ws/src - du -sh ${{ env.BASEDIR }}/target_ws diff --git a/templates/package/CI-github_ci-coverage-build.yml b/templates/package/CI-github_ci-coverage-build.yml index 5da04cd1..e765b419 100644 --- a/templates/package/CI-github_ci-coverage-build.yml +++ b/templates/package/CI-github_ci-coverage-build.yml @@ -16,13 +16,12 @@ jobs: - uses: ros-tooling/setup-ros@v0.2 with: required-ros-distributions: ${{ env.ROS_DISTRO }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ros-tooling/action-ros-ci@v0.2 with: target-ros2-distro: ${{ env.ROS_DISTRO }} import-token: ${{ secrets.GITHUB_TOKEN }} # build all packages listed in the meta package - # build all packages listed in the meta package package-name: $PKG_NAME$ vcs-repo-file-url: | diff --git a/templates/package/CI-github_ci-format-private.yml b/templates/package/CI-github_ci-format-private.yml index 1a0ceba0..74b114ef 100644 --- a/templates/package/CI-github_ci-format-private.yml +++ b/templates/package/CI-github_ci-format-private.yml @@ -16,14 +16,14 @@ jobs: name: Format runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - uses: actions/setup-python@v2 with: python-version: 3.9.7 - name: Install system hooks - run: sudo apt-get install clang-format-10 cppcheck + run: sudo apt install -qq clang-format-11 cppcheck - uses: pre-commit/action@v2.0.3 with: extra_args: --all-files --hook-stage manual diff --git a/templates/package/CI-github_ci-format.yml b/templates/package/CI-github_ci-format.yml index 7834f53d..77c35301 100644 --- a/templates/package/CI-github_ci-format.yml +++ b/templates/package/CI-github_ci-format.yml @@ -6,21 +6,18 @@ name: Format on: workflow_dispatch: pull_request: - push: - branches: - - $branch$ jobs: pre-commit: name: Format runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-python@v2 with: python-version: 3.9.7 - name: Install system hooks - run: sudo apt-get install clang-format-10 cppcheck + run: sudo apt install -qq clang-format-11 cppcheck - uses: pre-commit/action@v2.0.3 with: extra_args: --all-files --hook-stage manual diff --git a/templates/package/CI-github_ci-ros-lint.yml b/templates/package/CI-github_ci-ros-lint.yml index cc7c48f4..2872a841 100644 --- a/templates/package/CI-github_ci-ros-lint.yml +++ b/templates/package/CI-github_ci-ros-lint.yml @@ -1,4 +1,4 @@ -name: ROS2 Lint +name: ROS Lint on: pull_request: @@ -11,7 +11,7 @@ jobs: matrix: linter: [cppcheck, copyright, lint_cmake] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - uses: ros-tooling/setup-ros@v0.2 - uses: ros-tooling/action-ros-lint@v0.1 with: @@ -28,7 +28,7 @@ jobs: matrix: linter: [cpplint] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - uses: ros-tooling/setup-ros@v0.2 - uses: ros-tooling/action-ros-lint@v0.1 with: diff --git a/templates/package/CI-github_prerelease-check.yml b/templates/package/CI-github_prerelease-check.yml new file mode 100644 index 00000000..b9460bda --- /dev/null +++ b/templates/package/CI-github_prerelease-check.yml @@ -0,0 +1,39 @@ +name: Pre-Release Check + +on: + workflow_dispatch: + inputs: + ros_distro: + description: 'Chose ROS distribution' + required: true + default: 'rolling' + type: choice + options: + - foxy + - galactic + - humble + - rolling + branch: + description: 'Chose branch for distro' + required: true + default: 'master' + type: choice + options: + - foxy + - galactic + - humble + - master + +jobs: + pre_release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.branch }} + - name: industrial_ci + uses: ros-industrial/industrial_ci@master + env: + ROS_DISTRO: ${{ github.event.inputs.ros_distro }} + PRERELEASE: true + BASEDIR: ${{ github.workspace }}/.work diff --git a/templates/package/CI-github_reusable-industrial-ci-with-cache.yml b/templates/package/CI-github_reusable-industrial-ci-with-cache.yml new file mode 100644 index 00000000..9d272209 --- /dev/null +++ b/templates/package/CI-github_reusable-industrial-ci-with-cache.yml @@ -0,0 +1,106 @@ +name: Reusable industrial_ci Workflow with Cache +# Reusable action to simplify dealing with ROS/ROS2 industrial_ci builds with cache +# author: Denis Štogl + +on: + workflow_call: + inputs: + ref_for_scheduled_build: + description: 'Reference on which the repo should be checkout for scheduled build. Usually is this name of a branch or a tag.' + default: '' + required: false + type: string + + upstream_workspace: + description: 'UPSTREAM_WORKSPACE variable for industrial_ci. Usually path to local .repos file.' + required: true + type: string + ros_distro: + description: 'ROS_DISTRO variable for industrial_ci' + required: true + type: string + ros_repo: + description: 'ROS_REPO to run for industrial_ci. Possible values: "all", "main", "testing"' + default: 'all' + required: false + type: string + os_code_name: + description: 'OS_CODE_NAME variable for industrial_ci' + default: '' + required: false + type: string + before_install_upstream_dependencies: + description: 'BEFORE_INSTALL_UPSTREAM_DEPENDENCIES variable for industrial_ci' + default: '' + required: false + type: string + + ccache_dir: + description: 'Local path to store cache (from "github.workspace"). For standard industrial_ci configuration do not have to be changed' + default: '.ccache' + required: false + type: string + basedir: + description: 'Local path to workspace base directory to cache (from "github.workspace"). For standard industrial_ci configuration do not have to be changed' + default: '.work' + required: false + type: string + + +jobs: + reusable_industrial_ci_with_cache: + name: ${{ matrix.ROS_REPO }} ${{ inputs.ros_distro }} ${{ inputs.os_code_name }} + strategy: + fail-fast: false + matrix: + ROS_REPO: [ main, testing ] + runs-on: ubuntu-latest + env: + CCACHE_DIR: ${{ github.workspace }}/${{ inputs.ccache_dir }} + BASEDIR: ${{ github.workspace }}/${{ inputs.basedir }} + CACHE_PREFIX: ${{ inputs.ros_distro }}-${{ inputs.os_code_name }}-${{ matrix.ROS_REPO }}-${{ github.job }} + steps: + - name: Checkout ${{ inputs.ref }} when build is not scheduled + if: ${{ (inputs.ros_repo == 'all' || inputs.ros_repo == matrix.ROS_REPO) && github.event_name != 'schedule' }} + uses: actions/checkout@v3 + - name: Checkout ${{ inputs.ref }} on scheduled build + if: ${{ (inputs.ros_repo == 'all' || inputs.ros_repo == matrix.ROS_REPO) && github.event_name == 'schedule' }} + uses: actions/checkout@v3 + with: + ref: ${{ inputs.ref_for_scheduled_build }} + - name: cache target_ws + if: ${{ ! matrix.env.CCOV && (inputs.ros_repo == 'all' || inputs.ros_repo == matrix.ROS_REPO) }} + uses: pat-s/always-upload-cache@v2.1.5 + with: + path: ${{ env.BASEDIR }}/target_ws + key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} + restore-keys: | + target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} + - name: cache ccache + if: ${{ inputs.ros_repo == 'all' || inputs.ros_repo == matrix.ROS_REPO }} + uses: pat-s/always-upload-cache@v2.1.5 + with: + path: ${{ env.CCACHE_DIR }} + key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} + restore-keys: | + ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} + ccache-${{ env.CACHE_PREFIX }} + - if: ${{ inputs.ros_repo == 'all' || inputs.ros_repo == matrix.ROS_REPO }} + uses: 'ros-industrial/industrial_ci@master' + env: + UPSTREAM_WORKSPACE: ${{ inputs.upstream_workspace }} + ROS_DISTRO: ${{ inputs.ros_distro }} + ROS_REPO: ${{ matrix.ROS_REPO }} + OS_CODE_NAME: ${{ inputs.os_code_name }} + BEFORE_INSTALL_UPSTREAM_DEPENDENCIES: ${{ inputs.before_install_upstream_dependencies }} + - name: prepare target_ws for cache + if: ${{ always() && ! matrix.env.CCOV && (inputs.ros_repo == 'all' || inputs.ros_repo == matrix.ROS_REPO) }} + run: | + du -sh ${{ env.BASEDIR }}/target_ws + sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete + sudo rm -rf ${{ env.BASEDIR }}/target_ws/src + du -sh ${{ env.BASEDIR }}/target_ws + - name: Is job skipped? + if: ${{ ! (inputs.ros_repo == 'all' || inputs.ros_repo == matrix.ROS_REPO) }} + run: | + echo "This job is skpped!" diff --git a/templates/package/CI-github_rhel-binary-build.yml b/templates/package/CI-github_rhel-binary-build.yml new file mode 100644 index 00000000..92ed1583 --- /dev/null +++ b/templates/package/CI-github_rhel-binary-build.yml @@ -0,0 +1,30 @@ +name: $Ros_distro$ RHEL Binary Build +on: + pull_request: + branches: + - $branch$ + push: + branches: + - $branch$ + schedule: + # Run every day to detect flakiness and broken dependencies + - cron: '03 1 * * *' + + +jobs: + $ROS_DISTRO$_rhel_binary: + name: $Ros_distro$ RHEL binary build + runs-on: ubuntu-latest + env: + ROS_DISTRO: $ROS_DISTRO$ + container: jaronl/ros:$ROS_DISTRO$-alma + steps: + - uses: actions/checkout@v3 + with: + path: src/$NAME$ + - run: | + rosdep update + rosdep install -iy --from-path src/$NAME$ + source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash + colcon build + colcon test diff --git a/templates/package/CI-github_semi-binary-build.yml b/templates/package/CI-github_semi-binary-build.yml index 2f9334f7..0fba3bce 100644 --- a/templates/package/CI-github_semi-binary-build.yml +++ b/templates/package/CI-github_semi-binary-build.yml @@ -1,4 +1,6 @@ name: $Ros_distro$ Semi-Binary Build +# description: 'Build & test that compiles the main dependencies from source.' + on: pull_request: branches: @@ -8,49 +10,12 @@ on: - $branch$ schedule: # Run every morning to detect flakiness and broken dependencies - - cron: '13 4 * * *' + - cron: '33 1 * * *' jobs: - $ROS_DISTRO$_semi_binary: - name: $ROS_DISTRO$ semi-binary build - runs-on: ubuntu-latest - strategy: - matrix: - env: - - {ROS_DISTRO: $ROS_DISTRO$, ROS_REPO: main} - - {ROS_DISTRO: $ROS_DISTRO$, ROS_REPO: testing} - env: - UPSTREAM_WORKSPACE: $NAME$.${{ matrix.env.ROS_DISTRO }}.repos - CCACHE_DIR: ${{ github.workspace }}/.ccache - BASEDIR: ${{ github.workspace }}/.work - CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} - steps: - - uses: actions/checkout@v1 - # The target directory cache doesn't include the source directory because - # that comes from the checkout. See "prepare target_ws for cache" task below - - name: cache target_ws - if: ${{ ! matrix.env.CCOV }} - uses: pat-s/always-upload-cache@v2.1.5 - with: - path: ${{ env.BASEDIR }}/target_ws - key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} - restore-keys: | - target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} - - name: cache ccache - uses: pat-s/always-upload-cache@v2.1.5 - with: - path: ${{ env.CCACHE_DIR }} - key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} - restore-keys: | - ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} - ccache-${{ env.CACHE_PREFIX }} - - uses: 'ros-industrial/industrial_ci@master' - with: - config: ${{toJSON(matrix.env)}} - - name: prepare target_ws for cache - if: ${{ always() && ! matrix.env.CCOV }} - run: | - du -sh ${{ env.BASEDIR }}/target_ws - sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete - sudo rm -rf ${{ env.BASEDIR }}/target_ws/src - du -sh ${{ env.BASEDIR }}/target_ws + semi_binary: + uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + with: + ros_distro: $ROS_DISTRO$ + upstream_workspace: $NAME$.$ROS_DISTRO$.repos + ref_for_scheduled_build: $branch$ diff --git a/templates/package/CI-github_source-build.yml b/templates/package/CI-github_source-build.yml index 6a5efb60..c1a1173a 100644 --- a/templates/package/CI-github_source-build.yml +++ b/templates/package/CI-github_source-build.yml @@ -4,32 +4,12 @@ on: branches: - $branch$ schedule: - # Run every morning to detect flakiness and broken dependencies - - cron: '43 1 * * *' + # Run every day to detect flakiness and broken dependencies + - cron: '03 3 * * *' jobs: - rolling_source: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - env: - ROS_DISTRO: $ROS_DISTRO$ - steps: - - uses: ros-tooling/setup-ros@v0.2 - with: - required-ros-distributions: ${{ env.ROS_DISTRO }} - - uses: actions/checkout@v2 - - uses: ros-tooling/action-ros-ci@v0.2 - with: - target-ros2-distro: ${{ env.ROS_DISTRO }} - # build all packages listed in the meta package - package-name: - $PKG_NAME$ - vcs-repo-file-url: | - https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos - https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/$NAME$.repos?token=${{ secrets.GITHUB_TOKEN }} - colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml - - uses: actions/upload-artifact@v1 - with: - name: colcon-logs-${{ matrix.os }} - path: ros_ws/log + source: + uses: ./.github/workflows/reusable-ros-tooling-source-build.yml + with: + ros_distro: $ROS_DISTRO$ + ref: $branch$ diff --git a/templates/package/_NOT_YET_USED-Config-github_bots_behaviorbot.yml b/templates/package/_NOT_YET_USED-Config-github_bots_behaviorbot.yml new file mode 100644 index 00000000..8174c899 --- /dev/null +++ b/templates/package/_NOT_YET_USED-Config-github_bots_behaviorbot.yml @@ -0,0 +1,21 @@ +# Configuration for welcome - https://github.com/behaviorbot/welcome + +# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome + +# Comment to be posted to on first time issues +newIssueWelcomeComment: > + Thanks for reporting an issue. Because we're a volunteer community, providing a pull request with suggested changes is always welcomed. + +# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome + +# Comment to be posted to on PRs from first time contributors in your repository +newPRWelcomeComment: > + Thanks for helping in improving MoveIt 2 and open source robotics! + +# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge + +# Comment to be posted to on pull requests merged by a first time user +firstPRMergeComment: > + Congrats on getting your first MoveIt 2 pull request merged and improving open source robotics! + +# It is recommended to include as many gifs and emojis as possible! diff --git a/templates/package/_NOT_YET_USED-Config-github_bots_mergify.yml b/templates/package/_NOT_YET_USED-Config-github_bots_mergify.yml new file mode 100644 index 00000000..ac76cf9f --- /dev/null +++ b/templates/package/_NOT_YET_USED-Config-github_bots_mergify.yml @@ -0,0 +1,26 @@ +pull_request_rules: + - name: Backport to galactic at reviewers discretion + conditions: + - base=main + - "label=backport-galactic" + actions: + backport: + branches: + - galactic + + - name: backport to foxy at reviewers discretion + conditions: + - base=main + - "label=backport-foxy" + actions: + backport: + branches: + - foxy + + - name: ask to resolve conflict + conditions: + - conflict + - author!=mergify + actions: + comment: + message: This pull request is in conflict. Could you fix it @{{author}}? diff --git a/templates/package/_NOT_YET_USED_CI-github_ci-doxygen-deployment.yml b/templates/package/_NOT_YET_USED_CI-github_ci-doxygen-deployment.yml new file mode 100644 index 00000000..f2c49ce1 --- /dev/null +++ b/templates/package/_NOT_YET_USED_CI-github_ci-doxygen-deployment.yml @@ -0,0 +1,29 @@ +name: "Doxygen Deployment" +on: + workflow_dispatch: + push: + branches: + - master + - galactic + - foxy + +jobs: + deploy-doxygen: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set output + id: vars + run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} + - uses: mattnotmitt/doxygen-action@v1 + with: + doxyfile-path: 'smacc2_ci/Doxyfile' + + - uses: peaceiris/actions-gh-pages@v3 + with: + deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} + external_repository: robosoft-ai/SMACC2_Documentation + # publish_branch: gh-pages + publish_dir: docs/ + destination_dir: ${{ steps.vars.outputs.short_ref }} # Branch name + commit_message: ${{ github.event.head_commit.message }} diff --git a/templates/package/_append_to_README_ROS_Intro.md b/templates/package/_append_to_README_ROS_Intro.md index ad462e3d..2e3408d0 100644 --- a/templates/package/_append_to_README_ROS_Intro.md +++ b/templates/package/_append_to_README_ROS_Intro.md @@ -74,7 +74,7 @@ These instructions assume you are running Ubuntu 20.04: ``` cd $COLCON_WS git clone git@github.com:$NAMESPACE$/$NAME$.git src/$NAME$ - vcs import src --input src/$NAME$/$NAME$.repos + vcs import src --input src/$NAME$/$NAME$..repos rosdep install --ignore-src --from-paths src -y -r # install also is there are unreleased packages ```