diff --git a/.github/ignition_packages_installation.sh b/.github/ignition_packages_installation.sh new file mode 100755 index 0000000..84ac7dc --- /dev/null +++ b/.github/ignition_packages_installation.sh @@ -0,0 +1,72 @@ +#! /bin/bash + +####################################### +# Pulls apt keys from a few well known keyservers. +# +# We've seen the "default" keyserver (p80.pool.sks-keyservers.net) fail somewhat +# often. This function will try the default, followed by some alternates to +# reduce the number of times builds fail because of key problems. +# +# Arguments +# $1 -> apt key +# Asserts +# That apt key pulling was successful. +####################################### +pull_apt_keys() { + success=0 + for keyserver in hkp://p80.pool.sks-keyservers.net:80 hkp://pgp.mit.edu:80 hkp://keyserver.ubuntu.com:80 ; do + apt-key adv --keyserver $keyserver --recv-keys $1 || continue + success=1 + return 0 + done + return 1 +} + +####################################### +# Installs apt repository into system wide sources list. +# +# Arguments +# $1 -> name of the repository, to be used as sources list prefix. +# $2 -> url of the repository. +# $3 -> apt key for the repository. +####################################### +install_apt_repo() { + REPO_NAME=$1 + REPO_URL=$2 + REPO_KEY=$3 + + if ! grep -q "^deb .*$REPO_URL" /etc/apt/sources.list /etc/apt/sources.list.d/*; then + echo "deb $REPO_URL $(lsb_release -cs) main" | \ + tee --append /etc/apt/sources.list.d/$REPO_NAME.list > /dev/null + pull_apt_keys $REPO_KEY + echo "Apt Repo '$REPO_NAME'..........................installed" + else + echo "Apt Repo '$REPO_NAME'..........................found" + fi +} + +####################################### +# Install ignition packages. +# Returns: +# 0 if no error was detected, non-zero otherwise. +####################################### +function install_ignition_packages() { + + install_apt_repo gazebo-stable \ + http://packages.osrfoundation.org/gazebo/ubuntu-stable \ + D2486D2DD83DB69272AFE98867170598AF249743 + + apt update + apt install -y \ + libignition-cmake1-dev \ + libignition-cmake2-dev \ + libignition-common3-dev \ + libignition-math6-dev \ + libignition-msgs5-dev \ + libignition-gui3-dev \ + libignition-rendering3-dev \ + libignition-tools-dev \ + libignition-transport8-dev +} + +install_ignition_packages diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8030d1f..afb1ce7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,26 +85,10 @@ jobs: fetch-depth: 0 path: ${{ env.ROS_WS }}/src/drake_vendor token: ${{ secrets.MALIPUT_TOKEN }} - - uses: actions/checkout@v2 - with: - repository: ToyotaResearchInstitute/maliput_infrastructure - fetch-depth: 0 - path: maliput_infrastructure - token: ${{ secrets.MALIPUT_TOKEN }} - 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 delphyne prereqs using maliput_infrastructure/tools/prereqs.lib - - name: install delphyne prereqs - shell: bash - working-directory: ${{ env.ROS_WS }}/src/delphyne - run: ${GITHUB_WORKSPACE}/maliput_infrastructure/tools/prereqs-install -t ignition . - # install delphyne_gui prereqs using maliput_infrastructure/tools/prereqs.lib - - name: install delphyne_gui prereqs - shell: bash - working-directory: ${{ env.ROS_WS }}/src/delphyne_gui - run: ${GITHUB_WORKSPACE}/maliput_infrastructure/tools/prereqs-install -t ignition . # clone public dependencies - name: vcs import shell: bash @@ -125,6 +109,10 @@ jobs: shell: bash working-directory: ${{ env.ROS_WS }}/src/drake_vendor run: ./drake_installer + - name: install ignition packages + shell: bash + working-directory: ${{ env.ROS_WS }}/src + run: ./${PACKAGE_NAME}/.github/ignition_packages_installation.sh - name: colcon build libraries shell: bash working-directory: ${{ env.ROS_WS }} diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index 4ccb865..5a38cf8 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -103,26 +103,10 @@ jobs: fetch-depth: 0 path: ${{ env.ROS_WS }}/src/drake_vendor token: ${{ secrets.MALIPUT_TOKEN }} - - uses: actions/checkout@v2 - with: - repository: ToyotaResearchInstitute/maliput_infrastructure - fetch-depth: 0 - path: maliput_infrastructure - token: ${{ secrets.MALIPUT_TOKEN }} - 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 delphyne prereqs using maliput_infrastructure/tools/prereqs.lib - - name: install delphyne prereqs - shell: bash - working-directory: ${{ env.ROS_WS }}/src/delphyne - run: ${GITHUB_WORKSPACE}/maliput_infrastructure/tools/prereqs-install -t ignition . - # install delphyne_gui prereqs using maliput_infrastructure/tools/prereqs.lib - - name: install delphyne_gui prereqs - shell: bash - working-directory: ${{ env.ROS_WS }}/src/delphyne_gui - run: ${GITHUB_WORKSPACE}/maliput_infrastructure/tools/prereqs-install -t ignition . - name: clang 8 install shell: bash run: ${{ env.ROS_WS }}/src/${PACKAGE_NAME}/.github/clang_suite_installation.sh @@ -146,6 +130,10 @@ jobs: shell: bash working-directory: ${{ env.ROS_WS }}/src/drake_vendor run: ./drake_installer + - name: install ignition packages + shell: bash + working-directory: ${{ env.ROS_WS }}/src + run: ./${PACKAGE_NAME}/.github/ignition_packages_installation.sh - name: colcon build libraries shell: bash working-directory: ${{ env.ROS_WS }} diff --git a/.github/workflows/scan_build.yml b/.github/workflows/scan_build.yml index 4c9edda..b2b1beb 100644 --- a/.github/workflows/scan_build.yml +++ b/.github/workflows/scan_build.yml @@ -90,26 +90,10 @@ jobs: fetch-depth: 0 path: ${{ env.ROS_WS }}/src/drake_vendor token: ${{ secrets.MALIPUT_TOKEN }} - - uses: actions/checkout@v2 - with: - repository: ToyotaResearchInstitute/maliput_infrastructure - fetch-depth: 0 - path: maliput_infrastructure - token: ${{ secrets.MALIPUT_TOKEN }} - 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 delphyne prereqs using maliput_infrastructure/tools/prereqs.lib - - name: install delphyne prereqs - shell: bash - working-directory: ${{ env.ROS_WS }}/src/delphyne - run: ${GITHUB_WORKSPACE}/maliput_infrastructure/tools/prereqs-install -t ignition . - # install delphyne_gui prereqs using maliput_infrastructure/tools/prereqs.lib - - name: install delphyne_gui prereqs - shell: bash - working-directory: ${{ env.ROS_WS }}/src/delphyne_gui - run: ${GITHUB_WORKSPACE}/maliput_infrastructure/tools/prereqs-install -t ignition . - name: clang 8 install shell: bash run: ${{ env.ROS_WS }}/src/${PACKAGE_NAME}/.github/clang_suite_installation.sh @@ -133,6 +117,10 @@ jobs: shell: bash working-directory: ${{ env.ROS_WS }}/src/drake_vendor run: ./drake_installer + - name: install ignition packages + shell: bash + working-directory: ${{ env.ROS_WS }}/src + run: ./${PACKAGE_NAME}/.github/ignition_packages_installation.sh - name: colcon build up-to shell: bash working-directory: ${{ env.ROS_WS }}