image: doomseeker/doomseeker-build:latest

clone:
  depth: full

definitions:
  steps:
    - step: &qt5-build-and-test
        name: Qt5 build and test
        script:
          - mkdir -p build_qt5
          - cd build_qt5
          - cmake -DQt_PACKAGE=Qt5 -DCMAKE_CXX_FLAGS="-Wall -Werror=return-type" ..
          - make -j$(nproc)
          - make install
          - QT_QPA_PLATFORM=offscreen ./doomseeker --tests
    - step: &qt6-build-and-test
        name: Qt6 build and test
        script:
          - mkdir -p build_qt6
          - cd build_qt6
          - cmake -DQt_PACKAGE=Qt6 -DCMAKE_CXX_FLAGS="-Wall -Werror=return-type" ..
          - make -j$(nproc)
          - make install
          - QT_QPA_PLATFORM=offscreen ./doomseeker --tests

pipelines:
  branches:
    master:
      - parallel:
          steps:
            - step: *qt5-build-and-test
            - step: *qt6-build-and-test
  custom:
    Qt5Build:
      - step: *qt5-build-and-test
    Qt6Build:
      - step: *qt6-build-and-test
    AllBuilds:
      - parallel:
          steps:
            - step: *qt5-build-and-test
            - step: *qt6-build-and-test
