cache:
  key: "$CI_COMMIT_REF_SLUG"
  paths:
    - build/
  untracked: true

stages:
  - build
  - test
  - deploy

build:gcc8-seq-coverage:
  image: localhost:5000/ubuntu_gcc8
  stage: build
  script:
    - mkdir -p build
    - cd build
    - CXX=g++-8 CC=gcc-8 cmake .. -DCMAKE_BUILD_TYPE=Coverage
    - make pugs

test:gcc8-seq-coverage:
  image: localhost:5000/ubuntu_gcc8
  stage: test
  dependencies:
    - build:gcc8-seq-coverage
  script:
    - cd build
    - make run_unit_tests
    - make coverage

build:clang8-seq-coverage:
  image: localhost:5000/ubuntu_clang8
  stage: build
  script:
    - mkdir -p build
    - cd build
    - CXX=clang++-8 CC=clang-8 cmake .. -DCMAKE_BUILD_TYPE=Coverage -DCLANG_FORMAT=/usr/bin/clang-format-8
    - make pugs

test:clang8-seq-coverage:
  image: localhost:5000/ubuntu_clang8
  stage: test
  dependencies:
    - build:clang8-seq-coverage
  script:
    - cd build
    - make run_unit_tests
    - make coverage
