scan_build #204
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: scan_build | |
on: | |
pull_request: | |
types: [labeled] | |
workflow_dispatch: | |
schedule: | |
- cron: '0 9 * * 1' # 9:00am UTC, 1:00am PST every Monday. | |
env: | |
PACKAGE_NAME: maliput_infrastructure | |
ROS_DISTRO: foxy | |
ROS_WS: maliput_ws | |
jobs: | |
static_analysis: | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'do-static-analyzer-test') || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'}} | |
name: Static analysis | |
runs-on: ubuntu-latest | |
container: | |
image: ubuntu:20.04 | |
env: | |
CC: clang-8 | |
CXX: clang++-8 | |
LDFLAGS: -fuse-ld=lld-8 | |
steps: | |
# setup-ros first since it installs git, which is needed to fetch all branches from actions/checkout | |
- uses: ros-tooling/[email protected] | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
- uses: actions/checkout@v4 | |
with: | |
path: ${{ env.ROS_WS }}/src/${{ env.PACKAGE_NAME }} | |
- name: clang 8 install | |
shell: bash | |
working-directory: ${{ env.ROS_WS }}/src | |
run: ./${PACKAGE_NAME}/.github/clang_suite_installation.sh | |
# clone public dependencies | |
- name: vcs import | |
shell: bash | |
working-directory: ${{ env.ROS_WS }} | |
run: vcs import src < src/${PACKAGE_NAME}/.github/dependencies.repos | |
- 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/}} . | |
- run: colcon graph | |
shell: bash | |
working-directory: ${{ env.ROS_WS }} | |
- name: rosdep install | |
shell: bash | |
working-directory: ${{ env.ROS_WS }} | |
run: | | |
rosdep update --include-eol-distros; | |
rosdep install -i -y --rosdistro ${ROS_DISTRO} --from-paths src | |
- name: install drake | |
shell: bash | |
working-directory: ${{ env.ROS_WS }}/src/drake_vendor | |
run: ./drake_installer | |
- name: scan_build | |
shell: bash | |
working-directory: ${{ env.ROS_WS }}/src | |
run: | | |
. /opt/ros/${ROS_DISTRO}/setup.bash; | |
${PACKAGE_NAME}/tools/run_scan_build.py \ | |
--event-handlers=console_direct+; | |
# upload artifact | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: scan-build-output | |
path: /tmp/scan-build*/* | |
retention-days: 6 |