# Beware: git branch names need the 'refs/heads/' prefix, while tags need 'refs/tags/'
- project:
    name: tcwg_kernel-#{TOOLCHAIN}
    toolchain_name: #{TOOLCHAIN}
    binutils_url: git://sourceware.org/git/binutils-gdb.git
#if TOOLCHAIN_gnu
    gcc_url: git+ssh://linaroci@gcc.gnu.org/git/gcc.git
#elif TOOLCHAIN_llvm
    llvm_url: https://github.com/llvm/llvm-project.git
#endif
    qemu_url: https://gitlab.com/qemu-project/qemu.git
    toolchain_ver:
      - master:
          binutils_branch: master
#if TOOLCHAIN_gnu
          gcc_branch: master
#elif TOOLCHAIN_llvm
          llvm_branch: main
#endif
          qemu_branch: master
          distro: default
    target:
      - aarch64
      - arm
    linux:
      - next:
          linux_url: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next.git
          linux_branch: master
      - mainline:
          linux_url: https://gitlab.com/Linaro/lkft/mirrors/torvalds/linux-mainline.git
          linux_branch: master
      - stable:
          linux_url: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable.git
          linux_branch: linux-rolling-stable
      - lts:
          linux_url: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable.git
          linux_branch: linux-rolling-lts
    linux_config:
      - defconfig
      - allmodconfig
      - allyesconfig
      - allnoconfig
    jobs:
      - 'tcwg_kernel--{toolchain_name}-{toolchain_ver}-{target}-{linux}-{linux_config}-build'
      - 'tcwg_kernel--{toolchain_name}-{toolchain_ver}-{target}-{linux}-{linux_config}-bisect'
    ci_project: 'tcwg_kernel'
    ci_config: '{toolchain_name}-{toolchain_ver}-{target}-{linux}-{linux_config}'

#include tcwg/round-robin.yaml.inc

- job-template:
    name: tcwg_kernel--{toolchain_name}-{toolchain_ver}-{target}-{linux}-{linux_config}-build
    project-type: freestyle
    defaults: global
    properties:
      - build-properties:
          ci_project: '{ci_project}'
          ci_config: '{ci_config}'
    parameters:
      - build-parameters:
          default_git: 'default'
          distro: '{distro}'
    disabled: false
    node: tcwg-x86_64-build
    concurrent: false
    display-name: 'TCWG Build {ci_project}/{ci_config}'
    workspace: workspace/tcwg_kernel_$EXECUTOR_NUMBER
    scm:
      - build-scms:
          binutils_url: '{binutils_url}'
          binutils_branch: '{binutils_branch}'
#if TOOLCHAIN_gnu
          gcc_url: '{gcc_url}'
          gcc_branch: '{gcc_branch}'
#elif TOOLCHAIN_llvm
          llvm_url: '{llvm_url}'
          llvm_branch: '{llvm_branch}'
#endif
          qemu_url: '{qemu_url}'
          qemu_branch: '{qemu_branch}'
          linux_url: '{linux_url}'
          linux_branch: '{linux_branch}'
    triggers:
      - pollscm:
          cron: 'H H H/4 * *'
    wrappers:
      - build-wrappers:
          timeout: 600
    builders:
      - run-build:
          ci_project: '{ci_project}'
          ci_config: '{ci_config}'
          build_script: 'tcwg_kernel-build.sh'
    publishers:
      - build-publishers:
          email_on_failure: false
          email_on_success: true

- job-template:
    name: tcwg_kernel--{toolchain_name}-{toolchain_ver}-{target}-{linux}-{linux_config}-bisect
    project-type: freestyle
    defaults: global
    properties:
      - bisect-properties:
          ci_project: '{ci_project}'
          ci_config: '{ci_config}'
    parameters:
      - bisect-parameters:
          distro: '{distro}'
    disabled: false
    node: tcwg-x86_64-build
    concurrent: false
    display-name: 'TCWG Bisect {ci_project}/{ci_config}'
    workspace: workspace/tcwg_kernel_$EXECUTOR_NUMBER
    scm:
      - jenkins-scripts
    wrappers:
      - bisect-wrappers:
          timeout: 2880
    builders:
      - run-bisect:
          ci_project: '{ci_project}'
          ci_config: '{ci_config}'
          build_script: 'tcwg_kernel-build.sh'
    publishers:
      - bisect-publishers
