.lin-cache: &lin-cache
  key: "${CI_COMMIT_REF_SLUG}_linux"
  paths:
    - licence_swap/
    - .cache

.win-cache: &win-cache
  key: "${CI_COMMIT_REF_SLUG}_windows"
  paths:
    - licence_swap/
    - .cache

variables:  # Change pip's cache directory to be inside the project directory since we can only cache local items.
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  APT_DIR: "$CI_PROJECT_DIR/.cache/.apt"
  APT_STATE_LISTS: "$APT_DIR/lists"
  APT_CACHE_ARCHIVES: "$APT_DIR/archives"

stages:
  - build


build-ros:
  stage: build
  image: ros:humble
  cache:
    - <<: *lin-cache
  tags:
    - linux
  before_script:
   - git clone --recurse-submodules -j8 https://mygit.th-deg.de/roboct/robo_quality/rq_workflow
  script:
   - colcon build . --merge-install
  coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
  artifacts:
    when: always
    paths:
      - install
