# You can copy and paste this template into a new `.gitlab-ci.yml` file.
# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword.
#
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/C++.gitlab-ci.yml

# use the official gcc image, based on debian
# can use versions as well, like gcc:5.2
# see https://hub.docker.com/_/gcc/

# image: ubuntu

variables:
  GIT_SUBMODULE_STRATEGY: recursive
  GIT_STRATEGY: clone
  CI_DEBUG_SERVICES: "true"
  FF_ENABLE_JOB_CLEANUP: "true"

stages:
  - build
  - test


dind_build_rtcforgottenserver:
  stage: build
  image: docker:23.0.6
  variables:
    DOCKER_HOST: tcp://docker:2375/
    DOCKER_DRIVER: overlay2
    DOCKER_TLS_CERTDIR: ""
  services:
    - docker:23.0.6-dind
  rules:
    - when: manual
  script:
    - docker build . --tag rtcforgottenserver-$CI_COMMIT_SHA
  resource_group: dind


bind_build_rtcforgottenserver:
  stage: build
  image: docker:23.0.6
  rules:
    - when: manual
  script:
    - docker build . --tag rtcforgottenserver-$CI_COMMIT_SHA
    - echo "rtcforgottenserver-$CI_COMMIT_SHA"


run_test_matrixarea:
  stage: test
  image:
    name: rtcforgottenserver-$CI_COMMIT_SHA
    entrypoint: [""]
  script:
    - /bin/test_matrixarea


run_test_xtea:
  stage: test
  image:
    name: rtcforgottenserver-$CI_COMMIT_SHA
    entrypoint: [""]
  script:
    - /bin/test_xtea