Skip to content
Snippets Groups Projects
.gitlab-ci.yml 4.51 KiB
Newer Older
Simon Wittl's avatar
Simon Wittl committed
stages:
Simon Wittl's avatar
Simon Wittl committed
  - test
Simon Wittl's avatar
Simon Wittl committed
  - build
Simon Wittl's avatar
Simon Wittl committed
  - docu
Simon Wittl's avatar
Simon Wittl committed

Simon Wittl's avatar
Simon Wittl committed
.before_script_template: &before_script_template
Simon Wittl's avatar
Simon Wittl committed
  before_script:
Simon Wittl's avatar
Simon Wittl committed
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@mygit.th-deg.de/roboct/robo_quality/rq_interfaces
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@mygit.th-deg.de/roboct/robo_quality/rq_hardware
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@mygit.th-deg.de/roboct/robo_quality/rq_controller
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@mygit.th-deg.de/roboct/robo_quality/rq_ddetection
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@mygit.th-deg.de/roboct/robo_quality/rq_trajectory
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@mygit.th-deg.de/roboct/robo_quality/rq_reconstruction
    - apt-get update && apt-get install -y wget python3-pip
Simon Wittl's avatar
Simon Wittl committed
    - rosdep install --from-paths . -y --ignore-src
Simon Wittl's avatar
Simon Wittl committed
    - colcon build --merge-install
Simon Wittl's avatar
Simon Wittl committed

Simon Wittl's avatar
Simon Wittl committed
rq-pytests:
  stage: test
  image: ros:humble
Simon Wittl's avatar
Simon Wittl committed
  tags: 
    - ros2
Simon Wittl's avatar
Simon Wittl committed
  cache:
    key: cache-$CI_COMMIT_REF_SLUG
    paths:
Simon Wittl's avatar
Simon Wittl committed
      - install
Simon Wittl's avatar
Simon Wittl committed
  <<: *before_script_template
Simon Wittl's avatar
Simon Wittl committed
  script:
Simon Wittl's avatar
Simon Wittl committed
    - source ./install/setup.bash
Simon Wittl's avatar
Simon Wittl committed
    - pip3 install pytest pytest-cov netCDF4 ros2-numpy Pillow pyometiff scipy
    - python3 -m pytest ./rq_controller/test/ --cov=rq_controller --cov-report term --cov-report xml:controller_coverage.xml --junitxml=controller_report.xml --cov-report html:controller_cov_html
Simon Wittl's avatar
Simon Wittl committed
  coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
Simon Wittl's avatar
Simon Wittl committed

Simon Wittl's avatar
Simon Wittl committed
  artifacts:
    when: always
    paths:
      - controller_report.xml
      - controller_cov_html
    reports:
      junit: controller_report.xml
      coverage_report:
        coverage_format: cobertura
        path: controller_coverage.xml
Simon Wittl's avatar
Simon Wittl committed
rq-pytests-communication:
Simon Wittl's avatar
Simon Wittl committed
  stage: test
  image: ros:humble
  tags: 
    - ros2
  cache:
    key: cache-$CI_COMMIT_REF_SLUG
    paths:
      - install
  dependencies:
    - rq-pytests
  script:
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@mygit.th-deg.de/roboct/robo_quality/rq_workflow
    - source ./install/setup.bash
    - pip3 install pytest pytest-cov netCDF4 ros2-numpy Pillow pyometiff scipy
    - pip3 install -r ./rq_wokflow/requirements.txt
Simon Wittl's avatar
Simon Wittl committed
    - ros2 launch ./rq_wokflow/launch/echo_launch.py
Simon Wittl's avatar
Simon Wittl committed
    - python3 -m pytest ./rq_wokflow/test/ --junitxml=workflow_report.xml
Simon Wittl's avatar
Simon Wittl committed
  artifacts:
    when: always
    paths:
Simon Wittl's avatar
Simon Wittl committed
      - workflow_report.xml
Simon Wittl's avatar
Simon Wittl committed
    reports:
        junit: workflow_report.xml
Simon Wittl's avatar
Simon Wittl committed
build-ros:
  stage: build
Simon Wittl's avatar
Simon Wittl committed
  image: ros:humble
Simon Wittl's avatar
Simon Wittl committed
  tags: 
    - ros2
Simon Wittl's avatar
Simon Wittl committed
  cache:
    key: cache-$CI_COMMIT_REF_SLUG
    paths:
Simon Wittl's avatar
Simon Wittl committed
      - install
Simon Wittl's avatar
Simon Wittl committed
  dependencies:
    - rq-pytests
Simon Wittl's avatar
Simon Wittl committed
  script:
Simon Wittl's avatar
Simon Wittl committed
    - source ./install/setup.bash
Simon Wittl's avatar
Simon Wittl committed
  artifacts:
    when: always
    paths:
Simon Wittl's avatar
Simon Wittl committed
      - install
Simon Wittl's avatar
Simon Wittl committed
    name: ubuntu_humble
Simon Wittl's avatar
Simon Wittl committed

Simon Wittl's avatar
Simon Wittl committed
build-ros-win64:
  stage: build
  image: swittl/humble_win64
  tags:
    - windows
  script:
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@mygit.th-deg.de/roboct/robo_quality/rq_interfaces
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@mygit.th-deg.de/roboct/robo_quality/rq_hardware
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@mygit.th-deg.de/roboct/robo_quality/rq_controller
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@mygit.th-deg.de/roboct/robo_quality/rq_ddetection
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@mygit.th-deg.de/roboct/robo_quality/rq_trajectory
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@mygit.th-deg.de/roboct/robo_quality/rq_reconstruction
Simon Wittl's avatar
Simon Wittl committed
#    - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\Tools\\VsDevCmd.bat'
    - C:\dev\ros2_humble\setup.ps1
Simon Wittl's avatar
Simon Wittl committed
    - colcon build --merge-install
Simon Wittl's avatar
Simon Wittl committed
  cache:
    key: "${CI_COMMIT_REF_SLUG}_windows"
    paths:
      - .cache

Simon Wittl's avatar
Simon Wittl committed
  artifacts:
    when: always
    paths:
      - install
    name: win64_humble


Simon Wittl's avatar
Simon Wittl committed
create-docu:
  stage: docu
Simon Wittl's avatar
Simon Wittl committed
  image: ros:humble
Simon Wittl's avatar
Simon Wittl committed
  tags: 
    - ros2
Simon Wittl's avatar
Simon Wittl committed
  cache:
    key: cache-$CI_COMMIT_REF_SLUG
    paths:
Simon Wittl's avatar
Simon Wittl committed
      - install
Simon Wittl's avatar
Simon Wittl committed
  dependencies:
    - rq-pytests
Simon Wittl's avatar
Simon Wittl committed
  before_script:
Simon Wittl's avatar
Simon Wittl committed
    - apt-get update && apt-get install -y wget python3-pip
    - pip3 install pdoc3 netCDF4 ros2-numpy Pillow pyometiff scipy open3d pathfinding3d
    - git clone https://github.com/wittlsn/aRTist-PythonLib.git -b artist_thd_wip
    - pip3 install ./aRTist-PythonLib/
Simon Wittl's avatar
Simon Wittl committed
  script:
Simon Wittl's avatar
Simon Wittl committed
    - source ./install/setup.bash
Simon Wittl's avatar
Simon Wittl committed
    - mkdir -p doc
Simon Wittl's avatar
Simon Wittl committed
    - python3 -m pdoc --html rq_controller -o=./doc/rq_controller -c show_source_code=True
Simon Wittl's avatar
Simon Wittl committed
    # Uncomment the following line to generate documentation for rq_hardware
    # - python3 -m pdoc --html rq_hardware -o=./doc/rq_hardware -c show_source_code=True
Simon Wittl's avatar
Simon Wittl committed
  artifacts:
    when: always
    paths:
Simon Wittl's avatar
Simon Wittl committed
      - doc
Simon Wittl's avatar
Simon Wittl committed
    name: rq_docstrings