# SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
# SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception

---
include:
  - project: 'core/ci-config'
    ref: master
    file: 'config/common/master.yml'
  - project: 'core/ci-config'
    ref: master
    file: 'jobs/common/master.yml'

before_script:
  - duneci-install-module https://gitlab.dune-project.org/core/dune-common.git

variables:
# Suitesparse, as installed with Debian, is thread-parallel using OpenMP.
# OpenMP silently assumes, it can spawn as many threads as there are cores.
# In a worst case scenario, this leads to a number of threads quadratic in
# the core count, if you also do parallel test execution with the maximum
# number of cores. We solve the issue by disallowing OpenMP to allocate more
# than one thread.
  OMP_NUM_THREADS: 1

debian-11-gcc-9-17-with-checking:
  image: registry.dune-project.org/docker/ci/debian:11
  script: duneci-standard-test
  variables:
    DUNECI_TOOLCHAIN:   gcc-9-17
    DUNECI_CXXFLAGS: "-DDUNE_ISTL_WITH_CHECKING"
    DUNECI_CMAKE_FLAGS: "-DDUNE_MAX_TEST_CORES=4 -DCMAKE_DISABLE_FIND_PACKAGE_LATEX=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_Alberta=TRUE -DCMAKE_DISABLE_DOCUMENTATION=TRUE"
  tags: [duneci]

# no numpy version available for this image on the gitlab registry
# disable python bindings for now
ubuntu:18.04 clang-6-17:
  image: registry.dune-project.org/docker/ci/ubuntu:18.04
  script: duneci-standard-test
  stage: test
  variables:
    DUNECI_TOOLCHAIN: clang-6-17
    DUNECI_CMAKE_FLAGS: "-DDUNE_ENABLE_PYTHONBINDINGS=OFF"
  tags: [duneci]
ubuntu:18.04 clang-5-17:
  image: registry.dune-project.org/docker/ci/ubuntu:18.04
  script: duneci-standard-test
  stage: test
  variables:
    DUNECI_TOOLCHAIN: clang-5-17
    DUNECI_CMAKE_FLAGS: "-DDUNE_ENABLE_PYTHONBINDINGS=OFF"
  tags: [duneci]

# Check for spelling mistakes in text
code-spelling-check:
  stage: .pre
  # Avoid the global 'before_script'
  before_script: ""
  image: registry.dune-project.org/docker/ci/debian:11
  tags: [duneci]
  script:
  - codespell
    --ignore-words-list ba,eiter,equil,fo,parms

reuse:
  stage: .pre
  image:
    name: docker.io/fsfe/reuse:latest
    entrypoint: [""]
  tags: [duneci]
  before_script: ""
  script:
    - reuse lint