- project:
    name: #{RR}
    type_of_test: ""
#if RR_tcwg_flang_build
    # Trigger testing every hour
    cron: 'H * * * *'
    ci_project: tcwg_flang_build
    test_flags: ''
#elif RR_tcwg_flang_test
    # Trigger testing every 4 hours
    cron: 'H H/4 * * *'
    ci_project: tcwg_flang_test
    test_flags:
      - -Ofast-sve_vla
      - -Ofast-sve_vls-lto-lld
      - -O3-neoverse_v1-sve_vla-mpipeliner-stack_arrays
      - -O0-debug
#endif
#if COMPONENTS_llvm
    llvm_url: https://github.com/llvm/llvm-project.git
    llvm_branch: main
#endif
#if COMPONENTS_llvm_testsuite
    llvm_testsuite_url: https://github.com/llvm/llvm-test-suite.git
    llvm_testsuite_branch: main
#endif
#if COMPONENTS_fujitsu_testsuite
    fujitsu_testsuite_url: https://github.com/fujitsu/compiler-test-suite.git
    fujitsu_testsuite_branch: main
#endif
    target:
      - aarch64:
          node: tcwg-build && tcwg-sve
    distro: noble
    toolchain_ver: main
    jobs:
      - '{ci_project}--{toolchain_ver}-{target}{test_flags}-build'
      - '{ci_project}--{toolchain_ver}-{target}{test_flags}-bisect'
    ci_config: '{toolchain_ver}-{target}{test_flags}'

#include tcwg/round-robin.yaml.inc

- job-template:
    name: '{ci_project}--{toolchain_ver}-{target}{test_flags}-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: '{node}'
    concurrent: false
    display-name: 'TCWG Build {ci_project}/{ci_config}'
    workspace: workspace/tcwg_llvm_$EXECUTOR_NUMBER
    scm:
      - build-scms:
#if COMPONENTS_llvm
          llvm_url: '{llvm_url}'
          llvm_branch: '{llvm_branch}'
#endif
#if COMPONENTS_llvm_testsuite
          llvm_testsuite_url: '{llvm_testsuite_url}'
          llvm_testsuite_branch: '{llvm_testsuite_branch}'
#endif
#if COMPONENTS_fujitsu_testsuite
          fujitsu_testsuite_url: '{fujitsu_testsuite_url}'
          fujitsu_testsuite_branch: '{fujitsu_testsuite_branch}'
#endif
    triggers:
      - pollscm:
          cron: '{cron}'
    wrappers:
      - build-wrappers:
          timeout: 300
    builders:
      - run-build:
          ci_project: '{ci_project}'
          ci_config: '{ci_config}'
          build_script: 'tcwg_llvm-build.sh'
    publishers:
      - build-publishers:
          email_on_failure: false
          email_on_success: true

- job-template:
    name: '{ci_project}--{toolchain_ver}-{target}{test_flags}-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: '{node}'
    concurrent: false
    display-name: 'TCWG Bisect {ci_project}/{ci_config}'
    workspace: workspace/tcwg_llvm_$EXECUTOR_NUMBER
    scm:
      - jenkins-scripts
    wrappers:
      - bisect-wrappers:
          timeout: 3000
    builders:
      - run-bisect:
          ci_project: '{ci_project}'
          ci_config: '{ci_config}'
          build_script: 'tcwg_llvm-build.sh'
    publishers:
      - bisect-publishers
