.gitlab-ci.yml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. variables:
  2. AUTOWARE_CROSS_TARGET_PLATFORM: generic-aarch64
  3. .build: &build_common
  4. before_script:
  5. - mkdir -p src_tmp/${CI_PROJECT_NAME} && mv `find -maxdepth 1 -not -name . -not -name src_tmp` src_tmp/${CI_PROJECT_NAME} && mv src_tmp/ src/
  6. - sudo apt-get update
  7. - sudo apt-get install -y wget python3-pip python3-setuptools python3-colcon-common-extensions
  8. # Update setuptools from PyPI because the version Ubuntu ships with is too old
  9. - pip3 install -U setuptools
  10. - rosdep update
  11. script:
  12. - source /opt/ros/${ROS_DISTRO}/setup.bash
  13. - rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO}
  14. # We first build the entire workspace normally
  15. - colcon build --cmake-args -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage" -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage" -DCMAKE_BUILD_TYPE=Debug
  16. # And then build the tests target. catkin (ROS1) packages add their tests to the tests target
  17. # which is not the standard target for CMake projects. We need to trigger the tests target so that
  18. # tests are built and any fixtures are set up.
  19. - colcon build --cmake-target tests --cmake-args -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage" -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage" -DCMAKE_BUILD_TYPE=Debug
  20. - colcon test
  21. - colcon test-result --verbose
  22. .build_cross_vars: &build_cross_vars
  23. AUTOWARE_TARGET_ARCH: aarch64
  24. AUTOWARE_TOOLCHAIN_FILE_PATH: $CI_PROJECT_DIR/cross_toolchain.cmake
  25. AUTOWARE_SYSROOT: /sysroot/${AUTOWARE_CROSS_TARGET_PLATFORM}
  26. .build_cross: &build_cross_common
  27. script:
  28. - apt-get update && apt-get install -y python3-vcstool git build-essential wget
  29. - wget https://gitlab.com/autowarefoundation/autoware.ai/docker/raw/master/crossbuild/cross_toolchain.cmake
  30. - source ${AUTOWARE_SYSROOT}/opt/ros/${ROS_DISTRO}/setup.bash
  31. - colcon build
  32. --merge-install
  33. --cmake-args
  34. -DCMAKE_TOOLCHAIN_FILE=${AUTOWARE_TOOLCHAIN_FILE_PATH}
  35. -DCMAKE_SYSTEM_PROCESSOR=${AUTOWARE_TARGET_ARCH}
  36. -DCMAKE_PREFIX_PATH="${CI_PROJECT_DIR}/install;${AUTOWARE_SYSROOT}/opt/ros/${ROS_DISTRO}"
  37. -DCMAKE_FIND_ROOT_PATH=${CI_PROJECT_DIR}/install
  38. build_melodic:
  39. image: autoware/autoware:bleedingedge-melodic-base
  40. <<: *build_common
  41. only:
  42. - merge_requests
  43. - master
  44. build_melodic_arm:
  45. tags:
  46. - arm64
  47. image: autoware/arm64v8:bleedingedge-melodic-base
  48. <<: *build_common
  49. only:
  50. - branches@autowarefoundation/autoware.ai/messages
  51. build_melodic_cross:
  52. image: autoware/build:${AUTOWARE_CROSS_TARGET_PLATFORM}-melodic-bleedingedge
  53. variables:
  54. ROS_DISTRO: melodic
  55. <<: *build_cross_vars
  56. <<: *build_cross_common
  57. only:
  58. - merge_requests
  59. - master