diff --git a/.ci_templates/.install_bodydynamics.yml b/.ci_templates/.install_bodydynamics.yml new file mode 100644 index 0000000000000000000000000000000000000000..bfb4b1d950b2beef578e565dc7d84ed15951cbdb --- /dev/null +++ b/.ci_templates/.install_bodydynamics.yml @@ -0,0 +1,25 @@ +.install_bodydynamics_script: + - cd ${CI_PROJECT_DIR} + + # create 'ci_deps' folder (if not exists) + - mkdir -pv ci_deps + + # clone or pull + - cd ${CI_PROJECT_DIR}/ci_deps + - if [ -d bodydynamics ]; then + - echo "directory bodydynamics exists" + - cd bodydynamics + - git fetch --all + - git checkout $WOLF_BODYDYNAMICS_BRANCH + - git pull + - else + - git clone -b $WOLF_BODYDYNAMICS_BRANCH ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/wolf_projects/wolf_lib/plugins/bodydynamics.git + - cd bodydynamics + - fi + + # build and install + - mkdir -pv build + - cd build + - cmake -DCMAKE_BUILD_TYPE=release -DBUILD_DEMOS=OFF -DBUILD_TESTS=OFF .. + - make -j$(nproc) + - make install \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6001e454a4b805d260f13db450b6721ad07bc53e..6d108b2e70629b92f171edeeb4e51b694f0cd286 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,5 @@ include: + # core ci_templates - project: 'mobile_robotics/wolf_projects/wolf_lib/wolf' ref: 454-implementation-of-new-nodes-creation #$WOLF_CORE_BRANCH file: @@ -7,6 +8,11 @@ include: - '.ci_templates/.clang_format.yml' - '.ci_templates/.install_core.yml' - '.ci_templates/.preliminaries.yml' + # imu ci_templates + - project: 'mobile_robotics/wolf_projects/wolf_lib/plugins/imu' + ref: 28-adapt-to-new-sensor-constructors-in-core #$WOLF_IMU_BRANCH + file: + - '.ci_templates/.install_imu.yml' # RUN the pipeline if it is triggered: # - manually from web @@ -33,14 +39,15 @@ stages: ############ YAML ANCHORS ############ .print_variables_template: &print_variables_definition # Print variables - - echo $WOLF_CORE_BRANCH - echo $CI_COMMIT_BRANCH - - echo $WOLF_BODYDYNAMICS_BRANCH + - echo $WOLF_CORE_BRANCH - echo $WOLF_IMU_BRANCH + - echo $WOLF_BODYDYNAMICS_BRANCH .preliminaries_template: &preliminaries_definition ## OVERRIDE VARIABLES - export WOLF_CORE_BRANCH="454-implementation-of-new-nodes-creation" + - export WOLF_IMU_BRANCH="28-adapt-to-new-sensor-constructors-in-core" ## PRINT VARIABLES - *print_variables_definition @@ -51,24 +58,6 @@ stages: ## initialize build type as DEBUG - export BUILD_TYPE=debug -.install_wolfimu_template: &install_wolfimu_definition - - cd ${CI_PROJECT_DIR}/ci_deps - - if [ -d imu ]; then - - echo "directory imu exists" - - cd imu - - git fetch --all - - git checkout $WOLF_IMU_BRANCH - - git pull - - else - - git clone -b $WOLF_IMU_BRANCH ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/wolf_projects/wolf_lib/plugins/imu.git - - cd imu - - fi - - mkdir -pv build - - cd build - - cmake -DCMAKE_BUILD_TYPE=release -DBUILD_TESTS=OFF .. - - make -j$(nproc) - - make install - .build_and_test_template: &build_and_test_definition - cd $CI_PROJECT_DIR - mkdir -pv build @@ -109,7 +98,7 @@ yaml_templates_generation: - *preliminaries_definition - !reference [.install_yamlschemacpp_script] - !reference [.install_wolf_script] - - *install_wolfimu_definition + - !reference [.install_imu_script] script: - !reference [.generate_yaml_templates_script] @@ -131,8 +120,7 @@ build_and_test:bionic: - *preliminaries_definition - !reference [.install_yamlschemacpp_script] - !reference [.install_wolf_script] - - *install_wolfimu_definition - - ldconfig # update links (shared libraries) + - !reference [.install_imu_script] script: - *build_and_test_definition - export BUILD_TYPE=release @@ -156,8 +144,7 @@ build_and_test:focal: - *preliminaries_definition - !reference [.install_yamlschemacpp_script] - !reference [.install_wolf_script] - - *install_wolfimu_definition - - ldconfig # update links (shared libraries) + - !reference [.install_imu_script] script: - *build_and_test_definition - export BUILD_TYPE=release @@ -181,8 +168,7 @@ build_and_test:jammy: - *preliminaries_definition - !reference [.install_yamlschemacpp_script] - !reference [.install_wolf_script] - - *install_wolfimu_definition - - ldconfig # update links (shared libraries) + - !reference [.install_imu_script] script: - *build_and_test_definition - export BUILD_TYPE=release