From 0ec7cbcafc85e2d65af8def0ba97cfb2813de939 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Fri, 20 Nov 2020 10:48:06 -0800 Subject: [PATCH 1/2] Use maliput::test_utilities --- src/maliput_multilane_test_utilities/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/maliput_multilane_test_utilities/CMakeLists.txt b/src/maliput_multilane_test_utilities/CMakeLists.txt index 21ef877..3d6e54e 100644 --- a/src/maliput_multilane_test_utilities/CMakeLists.txt +++ b/src/maliput_multilane_test_utilities/CMakeLists.txt @@ -22,7 +22,7 @@ target_link_libraries(maliput_multilane_test_utilities drake::drake maliput::api maliput::common - maliput::maliput_test_utilities + maliput::test_utilities maliput::math maliput_multilane ) From 24f488a824bb636a9ce1bd669efabe7f9e6a6f1d Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Fri, 20 Nov 2020 14:31:41 -0800 Subject: [PATCH 2/2] Try to checkout same branch in dependencies This implements some behavior from our Jenkins CI that attemps to checkout a branch of the same name in all dependency packages. This requires setting `fetch-depth: 0` in the actions/checkout steps and installing git 2.18+ before those checkout steps. For 18.04, the git-core ppa is used; this will not be needed on 20.04. --- .github/try_vcs_checkout | 16 ++++++++++++++++ .github/workflows/build.yml | 20 ++++++++++++++++++-- .github/workflows/sanitizers.yml | 20 ++++++++++++++++++-- .github/workflows/scan_build.yml | 20 ++++++++++++++++++-- 4 files changed, 70 insertions(+), 6 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 372d9e2..38f5364 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,17 @@ 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 }} @@ -21,20 +32,25 @@ jobs: - 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/drake-vendor + fetch-depth: 0 path: ${{ env.ROS_WS }}/src/drake_vendor token: ${{ secrets.MALIPUT_TOKEN }} - uses: actions/checkout@v2 with: repository: ToyotaResearchInstitute/dsim-repos-index + fetch-depth: 0 path: dsim-repos-index token: ${{ secrets.MALIPUT_TOKEN }} - # use setup-ros action to get vcs, rosdep, and colcon - - uses: ros-tooling/setup-ros@0.0.26 + - name: check if dependencies have a matching branch + shell: bash + working-directory: ${{ env.ROS_WS }}/src + run: ./${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 diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index 32187e5..44e6b3e 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -34,6 +34,17 @@ jobs: 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: ${{ env.ROS_WS }}/src/${{ env.PACKAGE_NAME }} @@ -41,20 +52,25 @@ jobs: - 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/drake-vendor + fetch-depth: 0 path: ${{ env.ROS_WS }}/src/drake_vendor token: ${{ secrets.MALIPUT_TOKEN }} - uses: actions/checkout@v2 with: repository: ToyotaResearchInstitute/dsim-repos-index + fetch-depth: 0 path: dsim-repos-index token: ${{ secrets.MALIPUT_TOKEN }} - # use setup-ros action to get vcs, rosdep, and colcon - - uses: ros-tooling/setup-ros@0.0.26 + - name: check if dependencies have a matching branch + shell: bash + working-directory: ${{ env.ROS_WS }}/src + run: ./${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 diff --git a/.github/workflows/scan_build.yml b/.github/workflows/scan_build.yml index b33cc76..bf7a5a9 100644 --- a/.github/workflows/scan_build.yml +++ b/.github/workflows/scan_build.yml @@ -18,6 +18,17 @@ 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 }} @@ -25,20 +36,25 @@ jobs: - 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/drake-vendor + fetch-depth: 0 path: ${{ env.ROS_WS }}/src/drake_vendor token: ${{ secrets.MALIPUT_TOKEN }} - uses: actions/checkout@v2 with: repository: ToyotaResearchInstitute/dsim-repos-index + fetch-depth: 0 path: dsim-repos-index token: ${{ secrets.MALIPUT_TOKEN }} - # use setup-ros action to get vcs, rosdep, and colcon - - uses: ros-tooling/setup-ros@0.0.26 + - name: check if dependencies have a matching branch + shell: bash + working-directory: ${{ env.ROS_WS }}/src + run: ./${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