Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scan build #149

Merged
merged 11 commits into from
Dec 15, 2020
163 changes: 163 additions & 0 deletions .github/workflows/scan_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: scan_build

on:
push:
branches:
- master
pull_request:
schedule:
- cron: '0 9 * * 1' # 9:00am UTC, 1:00am PST every Monday.

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/[email protected]
# 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: ${GITHUB_WORKSPACE}/dsim-repos-index/.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+;