From af107665e507c8803cbd33aacf8f727bc29ec8a1 Mon Sep 17 00:00:00 2001 From: Agustin Alba Chicar Date: Tue, 17 Nov 2020 10:20:27 -0300 Subject: [PATCH 1/9] Adds Github Actions with nightly builds. --- .github/dependencies.repos | 9 +++ .github/workflows/build.yml | 107 ++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 .github/dependencies.repos create mode 100644 .github/workflows/build.yml diff --git a/.github/dependencies.repos b/.github/dependencies.repos new file mode 100644 index 0000000..62f5606 --- /dev/null +++ b/.github/dependencies.repos @@ -0,0 +1,9 @@ +repositories: + ament_cmake_doxygen: + type: git + url: https://github.com/ToyotaResearchInstitute/ament_cmake_doxygen + version: master + pybind11: + type: git + url: https://github.com/RobotLocomotion/pybind11.git + version: 69a5d92a5ff9fe84581a1edeb6051a8c21d9eb97 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c279c81 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,107 @@ +name: Compile and test + +on: + push: + pull_request: + schedule: + - cron: '0 9 * * *' # 9:00am UTC, 1:00am PST. + +env: + PACKAGE_NAME: dsim-repos-index + ROS_DISTRO: dashing + ROS_WS: maliput_ws + +jobs: + compile_and_test: + name: Compile and test + runs-on: ubuntu-18.04 + container: + image: ubuntu:18.04 + steps: + - uses: actions/checkout@v2 + with: + path: ${{ env.ROS_WS }}/src/${{ env.PACKAGE_NAME }} + # clone private dependencies + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput + path: ${{ env.ROS_WS }}/src/maliput + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-dragway + path: ${{ env.ROS_WS }}/src/maliput_dragway + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-multilane + path: ${{ env.ROS_WS }}/src/maliput_multilane + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/malidrive + path: ${{ env.ROS_WS }}/src/malidrive + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/delphyne + path: ${{ env.ROS_WS }}/src/delphyne + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/delphyne-gui + path: ${{ env.ROS_WS }}/src/delphyne-gui + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/drake-vendor + path: ${{ env.ROS_WS }}/src/drake_vendor + token: ${{ secrets.MALIPUT_TOKEN }} + # use setup-ros action to get vcs, rosdep, and colcon + - uses: ros-tooling/setup-ros@0.0.25 + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + # install drake_vendor prereqs using dsim-repos-index/tools/prereqs.lib + - name: install drake_vendor prereqs + shell: bash + working-directory: ${{ env.ROS_WS }}/src/drake_vendor + run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t drake . + # install delphyne prereqs using dsim-repos-index/tools/prereqs.lib + - name: install delphyne prereqs + shell: bash + working-directory: ${{ env.ROS_WS }}/src/delphyne + run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t ignition . + # install delphyne-gui prereqs using dsim-repos-index/tools/prereqs.lib + - name: install delphyne-gui prereqs + shell: bash + working-directory: ${{ env.ROS_WS }}/src/delphyne-gui + run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t ignition . + # clone public dependencies + - name: vcs import + shell: bash + working-directory: ${{ env.ROS_WS }} + run: vcs import src < src/${PACKAGE_NAME}/.github/dependencies.repos + - run: colcon graph + shell: bash + working-directory: ${{ env.ROS_WS }} + - name: rosdep install + shell: bash + working-directory: ${{ env.ROS_WS }} + run: | + rosdep update; + rosdep install -i -y --rosdistro ${ROS_DISTRO} \ + --skip-keys "ignition-transport5 ignition-msgs2 ignition-math6 ignition-common3 ignition-gui0 ignition-rendering2 libqt5multimedia5 pybind11" \ + --from-paths src + - name: colcon build libraries + shell: bash + working-directory: ${{ env.ROS_WS }} + run: | + . /opt/ros/${ROS_DISTRO}/setup.bash; + colcon build --event-handlers=console_direct+ + - name: colcon test + shell: bash + working-directory: ${{ env.ROS_WS }} + run: | + . /opt/ros/${ROS_DISTRO}/setup.bash; + colcon test --event-handlers=console_direct+; + colcon test-result --verbose; From 581712b5d14c5b66351130586d00f1b4b27b1702 Mon Sep 17 00:00:00 2001 From: Agustin Alba Chicar Date: Fri, 4 Dec 2020 08:56:46 -0300 Subject: [PATCH 2/9] - Adds missing private dependencies. - Adds behaviour to checkout custom branches by name. - Replaces path references to dsim-repos-index to configure the workspace. --- .github/try_vcs_checkout | 16 ++++++++++ .github/workflows/build.yml | 60 +++++++++++++++++++++++++++++++------ 2 files changed, 67 insertions(+), 9 deletions(-) create mode 100755 .github/try_vcs_checkout diff --git a/.github/try_vcs_checkout b/.github/try_vcs_checkout new file mode 100755 index 0000000..18290b2 --- /dev/null +++ b/.github/try_vcs_checkout @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright 2020 Toyota Research Institute + +CHANGE_BRANCH=$1 +SRC_FOLDER=$2 + +echo try checking out ${CHANGE_BRANCH} +vcs custom $SRC_FOLDER --args branch -f $CHANGE_BRANCH origin/$CHANGE_BRANCH > /dev/null || true +vcs custom $SRC_FOLDER --args merge --no-edit $CHANGE_BRANCH > /dev/null || true +DIFF=$(vcs diff -s $SRC_FOLDER | tr -d '.\n') +if [ ! -z "$DIFF" ]; then + echo "Have merge conflicts!" + echo $DIFF + exit 1 +fi +vcs status $SRC_FOLDER diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c279c81..435c743 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,69 +18,111 @@ jobs: container: image: ubuntu:18.04 steps: + # setup-ros first since it installs git, which is needed to fetch all branches from actions/checkout + - uses: ros-tooling/setup-ros@0.0.26 + # install git from ppa since git 2.18+ is needed to fetch all branches from actions/checkout + # this step can be removed on 20.04 + - name: install git from ppa + shell: bash + run: | + apt update; + apt install -y software-properties-common; + add-apt-repository -y -u ppa:git-core/ppa; + apt install -y git; - uses: actions/checkout@v2 with: - path: ${{ env.ROS_WS }}/src/${{ env.PACKAGE_NAME }} + path: ${{ PACKAGE_NAME }} # clone private dependencies - uses: actions/checkout@v2 with: repository: ToyotaResearchInstitute/maliput + fetch-depth: 0 path: ${{ env.ROS_WS }}/src/maliput token: ${{ secrets.MALIPUT_TOKEN }} - uses: actions/checkout@v2 with: repository: ToyotaResearchInstitute/maliput-dragway + fetch-depth: 0 path: ${{ env.ROS_WS }}/src/maliput_dragway token: ${{ secrets.MALIPUT_TOKEN }} - uses: actions/checkout@v2 with: repository: ToyotaResearchInstitute/maliput-multilane + fetch-depth: 0 path: ${{ env.ROS_WS }}/src/maliput_multilane token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput_malidrive + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_malidrive + token: ${{ secrets.MALIPUT_TOKEN }} - uses: actions/checkout@v2 with: repository: ToyotaResearchInstitute/malidrive + fetch-depth: 0 path: ${{ env.ROS_WS }}/src/malidrive token: ${{ secrets.MALIPUT_TOKEN }} - uses: actions/checkout@v2 with: repository: ToyotaResearchInstitute/delphyne + fetch-depth: 0 path: ${{ env.ROS_WS }}/src/delphyne token: ${{ secrets.MALIPUT_TOKEN }} - uses: actions/checkout@v2 with: repository: ToyotaResearchInstitute/delphyne-gui + fetch-depth: 0 path: ${{ env.ROS_WS }}/src/delphyne-gui token: ${{ secrets.MALIPUT_TOKEN }} - uses: actions/checkout@v2 with: repository: ToyotaResearchInstitute/drake-vendor + fetch-depth: 0 path: ${{ env.ROS_WS }}/src/drake_vendor token: ${{ secrets.MALIPUT_TOKEN }} - # use setup-ros action to get vcs, rosdep, and colcon - - uses: ros-tooling/setup-ros@0.0.25 - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-documentation + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_documentation + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-integration + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_integration + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-integration-tests + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_integration_tests + token: ${{ secrets.MALIPUT_TOKEN }} + - name: check if dependencies have a matching branch + shell: bash + working-directory: ${{ env.ROS_WS }}/src + run: ${GITHUB_WORKSPACE}/${PACKAGE_NAME}/.github/try_vcs_checkout ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} . # install drake_vendor prereqs using dsim-repos-index/tools/prereqs.lib - name: install drake_vendor prereqs shell: bash working-directory: ${{ env.ROS_WS }}/src/drake_vendor - run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t drake . + run: ${GITHUB_WORKSPACE}/${PACKAGE_NAME}/tools/prereqs-install -t drake . # install delphyne prereqs using dsim-repos-index/tools/prereqs.lib - name: install delphyne prereqs shell: bash working-directory: ${{ env.ROS_WS }}/src/delphyne - run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t ignition . + run: ${GITHUB_WORKSPACE}/${PACKAGE_NAME}/tools/prereqs-install -t ignition . # install delphyne-gui prereqs using dsim-repos-index/tools/prereqs.lib - name: install delphyne-gui prereqs shell: bash working-directory: ${{ env.ROS_WS }}/src/delphyne-gui - run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t ignition . + run: ${GITHUB_WORKSPACE}/${PACKAGE_NAME}/tools/prereqs-install -t ignition . # clone public dependencies - name: vcs import shell: bash working-directory: ${{ env.ROS_WS }} - run: vcs import src < src/${PACKAGE_NAME}/.github/dependencies.repos + run: vcs import src < ${GITHUB_WORKSPACE}/${PACKAGE_NAME}/.github/dependencies.repos - run: colcon graph shell: bash working-directory: ${{ env.ROS_WS }} From ecbe4e3a5ad4b393e87c753792e4c9d2147be649 Mon Sep 17 00:00:00 2001 From: Agustin Alba Chicar Date: Fri, 4 Dec 2020 15:35:21 -0300 Subject: [PATCH 3/9] Fixes clone path of dsim-repos-index --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 435c743..b474b49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: apt install -y git; - uses: actions/checkout@v2 with: - path: ${{ PACKAGE_NAME }} + path: ${GITHUB_WORKSPACE}/${PACKAGE_NAME} # clone private dependencies - uses: actions/checkout@v2 with: From 573d34a3a81888a9df9bdbb603c7f501d98a3634 Mon Sep 17 00:00:00 2001 From: Agustin Alba Chicar Date: Wed, 9 Dec 2020 09:05:57 -0300 Subject: [PATCH 4/9] Changed clone and referencing path of dsim-repos-index. --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b474b49..fb5fd81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: apt install -y git; - uses: actions/checkout@v2 with: - path: ${GITHUB_WORKSPACE}/${PACKAGE_NAME} + path: dsim-repos-index # clone private dependencies - uses: actions/checkout@v2 with: @@ -102,22 +102,22 @@ jobs: - name: check if dependencies have a matching branch shell: bash working-directory: ${{ env.ROS_WS }}/src - run: ${GITHUB_WORKSPACE}/${PACKAGE_NAME}/.github/try_vcs_checkout ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} . + run: ${GITHUB_WORKSPACE}/dsim-repos-index/.github/try_vcs_checkout ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} . # install drake_vendor prereqs using dsim-repos-index/tools/prereqs.lib - name: install drake_vendor prereqs shell: bash working-directory: ${{ env.ROS_WS }}/src/drake_vendor - run: ${GITHUB_WORKSPACE}/${PACKAGE_NAME}/tools/prereqs-install -t drake . + run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t drake . # install delphyne prereqs using dsim-repos-index/tools/prereqs.lib - name: install delphyne prereqs shell: bash working-directory: ${{ env.ROS_WS }}/src/delphyne - run: ${GITHUB_WORKSPACE}/${PACKAGE_NAME}/tools/prereqs-install -t ignition . + run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t ignition . # install delphyne-gui prereqs using dsim-repos-index/tools/prereqs.lib - name: install delphyne-gui prereqs shell: bash working-directory: ${{ env.ROS_WS }}/src/delphyne-gui - run: ${GITHUB_WORKSPACE}/${PACKAGE_NAME}/tools/prereqs-install -t ignition . + run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t ignition . # clone public dependencies - name: vcs import shell: bash From aa613fd079ac51d29a2c6c77f48da7463925cbb9 Mon Sep 17 00:00:00 2001 From: Agustin Alba Chicar Date: Wed, 9 Dec 2020 09:14:04 -0300 Subject: [PATCH 5/9] Adds clang and sanitizers to nightly builds. --- .github/clang_suite_installation.sh | 63 +++++++++++ .github/workflows/sanitizers.yml | 170 ++++++++++++++++++++++++++++ 2 files changed, 233 insertions(+) create mode 100755 .github/clang_suite_installation.sh create mode 100644 .github/workflows/sanitizers.yml diff --git a/.github/clang_suite_installation.sh b/.github/clang_suite_installation.sh new file mode 100755 index 0000000..ca51cd0 --- /dev/null +++ b/.github/clang_suite_installation.sh @@ -0,0 +1,63 @@ +#! /bin/bash + +####################################### +# Installs clang suite packages. +# Arguments: +# Version of the clang suite package. +# Returns: +# 0 if no error was detected, non-zero otherwise. +####################################### +function install_clang_suite() { + local version=$1 + + apt install -y \ + clang-${version} \ + lldb-${version} \ + lld-${version} \ + clang-format-${version} \ + clang-tidy-${version} \ + libc++-${version}-dev \ + libc++abi-${version}-dev +} + +####################################### +# Setups alternatives for clang suite. +# Arguments: +# Version of the clang suite package. +# Returns: +# 0 if no error was detected, 2 otherwise. +####################################### +function update_clang_suite_alternatives() { + local version=$1 + local priority=$2 + + update-alternatives \ + --install /usr/bin/clang clang /usr/bin/clang-${version} ${priority}\ + --slave /usr/bin/clang++ clang++ /usr/bin/clang++-${version} \ + --slave /usr/bin/asan_symbolize asan_symbolize /usr/bin/asan_symbolize-${version} \ + --slave /usr/bin/c-index-test c-index-test /usr/bin/c-index-test-${version} \ + --slave /usr/bin/clang-check clang-check /usr/bin/clang-check-${version} \ + --slave /usr/bin/clang-cl clang-cl /usr/bin/clang-cl-${version} \ + --slave /usr/bin/clang-cpp clang-cpp /usr/bin/clang-cpp-${version} \ + --slave /usr/bin/clang-format clang-format /usr/bin/clang-format-${version} \ + --slave /usr/bin/clang-format-diff clang-format-diff /usr/bin/clang-format-diff-${version} \ + --slave /usr/bin/clang-import-test clang-import-test /usr/bin/clang-import-test-${version} \ + --slave /usr/bin/clang-include-fixer clang-include-fixer /usr/bin/clang-include-fixer-${version} \ + --slave /usr/bin/clang-offload-bundler clang-offload-bundler /usr/bin/clang-offload-bundler-${version} \ + --slave /usr/bin/clang-query clang-query /usr/bin/clang-query-${version} \ + --slave /usr/bin/clang-rename clang-rename /usr/bin/clang-rename-${version} \ + --slave /usr/bin/clang-reorder-fields clang-reorder-fields /usr/bin/clang-reorder-fields-${version} \ + --slave /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${version} \ + --slave /usr/bin/lldb lldb /usr/bin/lldb-${version} \ + --slave /usr/bin/lldb-server lldb-server /usr/bin/lldb-server-${version} +} + + +####################################### +# Modify clang suite version and priority as required. +####################################### +CLANG_SUITE_VERSION=8 +CLANG_SUITE_ALTERNATIVE_PRIORITY=10 + +install_clang_suite ${CLANG_SUITE_VERSION} +update_clang_suite_alternatives ${CLANG_SUITE_VERSION} ${CLANG_SUITE_ALTERNATIVE_PRIORITY} diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml new file mode 100644 index 0000000..3bdf95a --- /dev/null +++ b/.github/workflows/sanitizers.yml @@ -0,0 +1,170 @@ +name: clang + +on: + push: + branches: + - master + pull_request: + schedule: + - cron: '0 9 * * *' # 9:00am UTC, 1:00am PST. + +env: + PACKAGE_NAME: dsim-repos-index + ROS_DISTRO: dashing + ROS_WS: maliput_ws + +jobs: + compile_and_test: + name: Compile and test + runs-on: ubuntu-18.04 + container: + image: ubuntu:18.04 + strategy: + matrix: + sanitizer: [none, asan, ubsan] + include: + - sanitizer: none + COMPILER_FLAG: '' + - sanitizer: asan + COMPILER_FLAG: ' -DADDRESS_SANITIZER=On' + - sanitizer: ubsan + COMPILER_FLAG: ' -DUNDEFINED_SANITIZER=On' + env: + CC: clang + CXX: clang++ + LINKER_PATH: /usr/bin/llvm-ld + steps: + # setup-ros first since it installs git, which is needed to fetch all branches from actions/checkout + - uses: ros-tooling/setup-ros@0.0.26 + # install git from ppa since git 2.18+ is needed to fetch all branches from actions/checkout + # this step can be removed on 20.04 + - name: install git from ppa + shell: bash + run: | + apt update; + apt install -y software-properties-common; + add-apt-repository -y -u ppa:git-core/ppa; + apt install -y git; + - uses: actions/checkout@v2 + with: + path: dsim-repos-index + # clone private dependencies + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-dragway + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_dragway + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-multilane + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_multilane + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput_malidrive + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_malidrive + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/malidrive + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/malidrive + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/delphyne + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/delphyne + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/delphyne-gui + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/delphyne-gui + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/drake-vendor + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/drake_vendor + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-documentation + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_documentation + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-integration + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_integration + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-integration-tests + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_integration_tests + token: ${{ secrets.MALIPUT_TOKEN }} + - name: check if dependencies have a matching branch + shell: bash + working-directory: ${{ env.ROS_WS }}/src + run: ${GITHUB_WORKSPACE}/dsim-repos-index/.github/try_vcs_checkout ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} . + # install drake_vendor prereqs using dsim-repos-index/tools/prereqs.lib + - name: install drake_vendor prereqs + shell: bash + working-directory: ${{ env.ROS_WS }}/src/drake_vendor + run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t drake . + # install delphyne prereqs using dsim-repos-index/tools/prereqs.lib + - name: install delphyne prereqs + shell: bash + working-directory: ${{ env.ROS_WS }}/src/delphyne + run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t ignition . + # install delphyne-gui prereqs using dsim-repos-index/tools/prereqs.lib + - name: install delphyne-gui prereqs + shell: bash + working-directory: ${{ env.ROS_WS }}/src/delphyne-gui + run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t ignition . + - name: clang 8 install + shell: bash + run: ${{ env.ROS_WS }}/src/${PACKAGE_NAME}/.github/clang_suite_installation.sh + # clone public dependencies + - name: vcs import + shell: bash + working-directory: ${{ env.ROS_WS }} + run: vcs import src < ${GITHUB_WORKSPACE}/${PACKAGE_NAME}/.github/dependencies.repos + - run: colcon graph + shell: bash + working-directory: ${{ env.ROS_WS }} + - name: rosdep install + shell: bash + working-directory: ${{ env.ROS_WS }} + run: | + rosdep update; + rosdep install -i -y --rosdistro ${ROS_DISTRO} \ + --skip-keys "ignition-transport5 ignition-msgs2 ignition-math6 ignition-common3 ignition-gui0 ignition-rendering2 libqt5multimedia5 pybind11" \ + --from-paths src + - name: colcon build libraries + shell: bash + working-directory: ${{ env.ROS_WS }} + run: | + . /opt/ros/${ROS_DISTRO}/setup.bash; + colcon build --cmake-args -DCMAKE_LINKER=${LINKER_PATH} \ + --event-handlers=console_direct+ \ + ${COMPILER_FLAG} + - name: colcon test + shell: bash + working-directory: ${{ env.ROS_WS }} + run: | + . /opt/ros/${ROS_DISTRO}/setup.bash; + colcon test --event-handlers=console_direct+; + colcon test-result --verbose; From 72145d0d0684f4ab01a234cce62307f53ca40e3f Mon Sep 17 00:00:00 2001 From: Agustin Alba Chicar Date: Wed, 9 Dec 2020 11:44:07 -0300 Subject: [PATCH 6/9] Fix clang installation script path. --- .github/workflows/sanitizers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index 3bdf95a..c06b402 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -136,7 +136,7 @@ jobs: run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t ignition . - name: clang 8 install shell: bash - run: ${{ env.ROS_WS }}/src/${PACKAGE_NAME}/.github/clang_suite_installation.sh + run: ${GITHUB_WORKSPACE}/dsim-repos-index/.github/clang_suite_installation.sh # clone public dependencies - name: vcs import shell: bash From 75fe69c000aad17e77d8ebd5e1944cda0df8922b Mon Sep 17 00:00:00 2001 From: Agustin Alba Chicar Date: Wed, 9 Dec 2020 11:07:57 -0300 Subject: [PATCH 7/9] Adds scan build. --- .github/workflows/scan_build.yml | 163 +++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 .github/workflows/scan_build.yml diff --git a/.github/workflows/scan_build.yml b/.github/workflows/scan_build.yml new file mode 100644 index 0000000..5ac4df9 --- /dev/null +++ b/.github/workflows/scan_build.yml @@ -0,0 +1,163 @@ +name: scan_build + +on: + push: + branches: + - master + pull_request: + schedule: + - cron: '0 9 * * *' # 9:00am UTC, 1:00am PST. + +env: + PACKAGE_NAME: dsim-repos-index + ROS_DISTRO: dashing + ROS_WS: maliput_ws + +jobs: + compile_and_test: + name: Compile and test + runs-on: ubuntu-18.04 + container: + image: ubuntu:18.04 + strategy: + matrix: + sanitizer: [none, asan, ubsan] + include: + - sanitizer: none + COMPILER_FLAG: '' + - sanitizer: asan + COMPILER_FLAG: ' -DADDRESS_SANITIZER=On' + - sanitizer: ubsan + COMPILER_FLAG: ' -DUNDEFINED_SANITIZER=On' + env: + CC: clang + CXX: clang++ + LINKER_PATH: /usr/bin/llvm-ld + steps: + # setup-ros first since it installs git, which is needed to fetch all branches from actions/checkout + - uses: ros-tooling/setup-ros@0.0.26 + # install git from ppa since git 2.18+ is needed to fetch all branches from actions/checkout + # this step can be removed on 20.04 + - name: install git from ppa + shell: bash + run: | + apt update; + apt install -y software-properties-common; + add-apt-repository -y -u ppa:git-core/ppa; + apt install -y git; + - uses: actions/checkout@v2 + with: + path: dsim-repos-index + # clone private dependencies + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-dragway + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_dragway + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-multilane + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_multilane + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput_malidrive + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_malidrive + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/malidrive + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/malidrive + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/delphyne + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/delphyne + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/delphyne-gui + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/delphyne-gui + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/drake-vendor + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/drake_vendor + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-documentation + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_documentation + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-integration + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_integration + token: ${{ secrets.MALIPUT_TOKEN }} + - uses: actions/checkout@v2 + with: + repository: ToyotaResearchInstitute/maliput-integration-tests + fetch-depth: 0 + path: ${{ env.ROS_WS }}/src/maliput_integration_tests + token: ${{ secrets.MALIPUT_TOKEN }} + - name: check if dependencies have a matching branch + shell: bash + working-directory: ${{ env.ROS_WS }}/src + run: ${GITHUB_WORKSPACE}/dsim-repos-index/.github/try_vcs_checkout ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} . + # install drake_vendor prereqs using dsim-repos-index/tools/prereqs.lib + - name: install drake_vendor prereqs + shell: bash + working-directory: ${{ env.ROS_WS }}/src/drake_vendor + run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t drake . + # install delphyne prereqs using dsim-repos-index/tools/prereqs.lib + - name: install delphyne prereqs + shell: bash + working-directory: ${{ env.ROS_WS }}/src/delphyne + run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t ignition . + # install delphyne-gui prereqs using dsim-repos-index/tools/prereqs.lib + - name: install delphyne-gui prereqs + shell: bash + working-directory: ${{ env.ROS_WS }}/src/delphyne-gui + run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t ignition . + - name: clang 8 install + shell: bash + run: ${{ env.ROS_WS }}/src/${PACKAGE_NAME}/.github/clang_suite_installation.sh + # clone public dependencies + - name: vcs import + shell: bash + working-directory: ${{ env.ROS_WS }} + run: vcs import src < ${GITHUB_WORKSPACE}/${PACKAGE_NAME}/.github/dependencies.repos + - run: colcon graph + shell: bash + working-directory: ${{ env.ROS_WS }} + - name: rosdep install + shell: bash + working-directory: ${{ env.ROS_WS }} + run: | + rosdep update; + rosdep install -i -y --rosdistro ${ROS_DISTRO} \ + --skip-keys "ignition-transport5 ignition-msgs2 ignition-math6 ignition-common3 ignition-gui0 ignition-rendering2 libqt5multimedia5 pybind11" \ + --from-paths src + - name: scan_build + shell: bash + working-directory: ${{ env.ROS_WS }} + run: | + . /opt/ros/${ROS_DISTRO}/setup.bash; + ${GITHUB_WORKSPACE}/${PACKAGE_NAME}/tools/run_scan_build.py \ + --cmake-args -DCMAKE_LINKER=/usr/bin/llvm-ld \ + --event-handlers=console_direct+; From ec7dec0c11800c53494f107675c8b91f7f2c6cd9 Mon Sep 17 00:00:00 2001 From: Agustin Alba Chicar Date: Wed, 9 Dec 2020 11:51:03 -0300 Subject: [PATCH 8/9] Fix clang installation script path. --- .github/workflows/scan_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scan_build.yml b/.github/workflows/scan_build.yml index 5ac4df9..9ffdf0b 100644 --- a/.github/workflows/scan_build.yml +++ b/.github/workflows/scan_build.yml @@ -136,7 +136,7 @@ jobs: run: ${GITHUB_WORKSPACE}/dsim-repos-index/tools/prereqs-install -t ignition . - name: clang 8 install shell: bash - run: ${{ env.ROS_WS }}/src/${PACKAGE_NAME}/.github/clang_suite_installation.sh + run: ${GITHUB_WORKSPACE}/dsim-repos-index/.github/clang_suite_installation.sh # clone public dependencies - name: vcs import shell: bash From b0d7c664401482457a589f62c8ae45f1b648b9b3 Mon Sep 17 00:00:00 2001 From: Agustin Alba Chicar Date: Mon, 14 Dec 2020 18:06:27 -0300 Subject: [PATCH 9/9] Changes scan_build nightly to run every Monday (weekly frequency). --- .github/workflows/scan_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scan_build.yml b/.github/workflows/scan_build.yml index 9ffdf0b..9b14663 100644 --- a/.github/workflows/scan_build.yml +++ b/.github/workflows/scan_build.yml @@ -6,7 +6,7 @@ on: - master pull_request: schedule: - - cron: '0 9 * * *' # 9:00am UTC, 1:00am PST. + - cron: '0 9 * * 1' # 9:00am UTC, 1:00am PST every Monday. env: PACKAGE_NAME: dsim-repos-index