image: python:3.7.7-buster

variables:
  GIT_STRATEGY: fetch
  GIT_SUBMODULE_STRATEGY: normal

###### Test jobs #####

.test:meson: &conan_def
  script:
    - python -m pip install conan
    - conan create . -s build_type=$BUILD_TYPE
  tags:
    - mfix-exa

test:meson:debug:
  variables:
    BUILD_TYPE: "Debug"
  <<: *conan_def

test:meson:release:
  variables:
    BUILD_TYPE: "Release"
  allow_failure: true
  <<: *conan_def

.test:cmake: &cmake_def
  script:
    - python -m pip install cmake ninja conan
    - cmake -S. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE
    - cmake --build build --target unit_tests_csg
    - cd build
    - ctest
  tags:
    - mfix-exa

test:cmake:debug:
  variables:
    BUILD_TYPE: "Debug"
  <<: *cmake_def

test:cmake:release:
  variables:
    BUILD_TYPE: "Release"
  allow_failure: true
  <<: *cmake_def
