stages:
  - preparation
  - build
  - check
  - release
  - package

variables:
  # Build config
  BUILD_TYPE: Release
  BUILD_PROCESSES: "" # Empty string: builds all processes
  BUILD_TESTS: "true"
  BUILD_CTEST: "true"

workflow:
  rules:
    # Disable CI for non-MR user-scoped pipelines
    - if: '$CI_MERGE_REQUEST_IID == null && $CI_PROJECT_NAMESPACE != "ogs"'
      when: never
    - if: '$CI_MERGE_REQUEST_LABELS =~ /.*(workflow::paused|ci skip).*/'
      when: never
    - if: $CI_MERGE_REQUEST_IID                         # merge requests
    - if: $CI_COMMIT_TAG                                # tags, ogs/ogs repo only
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH       # master, ogs/ogs repo only
    - if: $CI_COMMIT_BRANCH =~ /^v[0-9]\.[0-9]\.[0-9]/  # release branches, e.g. v6.x.x

include:
  - local: 'scripts/ci/extends/*.yml'
  - local: '/scripts/ci/jobs/meta.yml'
  - local: '/scripts/ci/jobs/ci_images.yml'
  - local: '/scripts/ci/jobs/pre-commit.yml'
  # jobs, can be indiviually disabled for testing
  - local: '/scripts/ci/jobs/build-linux.yml'
  - local: '/scripts/ci/jobs/build-linux-petsc.yml'
  - local: '/scripts/ci/jobs/build-linux-frontend.yml'
  - local: '/scripts/ci/jobs/build-docs.yml'
  - local: '/scripts/ci/jobs/build-win.yml'
  - local: '/scripts/ci/jobs/build-mac.yml'
  # - template: 'Code-Quality.gitlab-ci.yml' # see !3053
  - local: '/scripts/ci/jobs/code-quality.yml'
  - local: '/scripts/ci/jobs/code-coverage.yml'
  - local: '/scripts/ci/jobs/build-gui-linux.yml'
  - local: '/scripts/ci/jobs/build-gui-win.yml'
  - local: '/scripts/ci/jobs/build-gui-mac.yml'
  - local: '/scripts/ci/jobs/check-header.yml'
  - local: '/scripts/ci/jobs/clang-sanitizer.yml'
  - local: '/scripts/ci/jobs/clang-tidy.yml'
  - local: '/scripts/ci/jobs/web.yml'
  - local: '/scripts/ci/jobs/container.yml'
  - local: '/scripts/ci/jobs/release.yml'
