image: registry.gitlab.com/stuko/ovito/linux_build:latest

test_linux:
   stage: build
   tags:
      - linux
   script:
      # Create a build directory.
      - mkdir build
      - cd build

      # Configure the build.
      # For the list of required dependencies, see doc/manual/development/build_linux.rst.
      - cmake -G Ninja
           -DCMAKE_BUILD_TYPE=Debug
           -DCMAKE_INSTALL_PREFIX=../install
           ..
      
      # Build and install the application:
      - cmake --build . --parallel --target install
      
      # Test if the application can be started -- at least in headless mode:
      - ../install/bin/ovito --nogui

      # Run any tests the CMake script may have defined:
      - ctest --output-on-failure
