.gitlab-shared-docker:
  image: ubuntu:noble
  tags:
    - gitlab-org-docker
  stage: test
  interruptible: true
  rules:
    - if: $CI_PROJECT_PATH != "cryptsetup/cryptsetup"
      when: never
    - if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /v2\..\.x$/
  before_script:
    - .gitlab/ci/cibuild-setup-ubuntu.sh
    - export CC="${COMPILER}${COMPILER_VERSION:+-$COMPILER_VERSION}"
    - export CXX="${COMPILER}++${COMPILER_VERSION:+-$COMPILER_VERSION}"

.gitlab-shared-gcc:
  extends:
    - .gitlab-shared-docker
  variables:
    COMPILER: "gcc"
    COMPILER_VERSION: "13"
    CC: "gcc-13"
    RUN_SSH_PLUGIN_TEST: "1"

.gitlab-shared-clang:
  extends:
    - .gitlab-shared-docker
  variables:
    COMPILER: "clang"
    COMPILER_VERSION: "18"
    CC: "clang-18"
    RUN_SSH_PLUGIN_TEST: "1"
