stages:
   - static-analysis
   - build
variables:
      GIT_SUBMODULE_STRATEGY: none

.build_template:
   stage: build
   script:
      - make sadlclean
      - make realclean
      - make all
   only:
      refs:
         - VTM-11.0_nnvc 
         - merge_requests
      variables:
         - $CI_PROJECT_URL == 'https://vcgit.hhi.fraunhofer.de/jvet-ahg-nnvc/VVCSoftware_VTM'
         - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'VTM-11.0_nnvc'
         

.build_template_linux:
   extends: .build_template
   script:
      - make sadlclean
      - make realclean
      - make all
      - make realclean
      - make linuxbuild enable-tracing=true

build_macos:
   extends: .build_template
   tags:
      - macos

build_ubuntu2004:
   extends: .build_template_linux
   tags:
      - ubuntu2004

build_ubuntu2204:
   extends: .build_template_linux
   tags:
      - ubuntu2204

build_vc191x:
   extends: .build_template
   tags:
      - vc191x

build_vc192x:
   extends: .build_template
   tags:
      - vc192x

flake8:
  stage: static-analysis
  script:
    - flake8 --version
    - flake8 training
  tags:
    - ubuntu2004