---
schedules:
- cron: "0 19 * * *"
  displayName: Nightly Builds
  branches:
    include:
    - master
  always: true

trigger: none

pool:
  vmImage: 'ubuntu-20.04'

stages:

# Fedora

- stage: FedoraLatest_Ansible_Core_2_13
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: fedora-latest
      ansible_version: "-core >=2.13,<2.14"

- stage: FedoraLatest_Ansible_Core_2_14
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: fedora-latest
      ansible_version: "-core >=2.14,<2.15"

- stage: FedoraLatest_Ansible_Core_2_15
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: fedora-latest
      ansible_version: "-core >=2.15,<2.16"

- stage: FedoraLatest_Ansible_latest
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: fedora-latest
      ansible_version: ""

# Galaxy on Fedora

- stage: Galaxy_FedoraLatest_Ansible_Core_2_13
  dependsOn: []
  jobs:
  - template: templates/galaxy_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: fedora-latest
      ansible_version: "-core >=2.13,<2.14"

- stage: Galaxy_FedoraLatest_Ansible_Core_2_14
  dependsOn: []
  jobs:
  - template: templates/galaxy_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: fedora-latest
      ansible_version: "-core >=2.14,<2.15"

- stage: Galaxy_FedoraLatest_Ansible_Core_2_15
  dependsOn: []
  jobs:
  - template: templates/galaxy_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: fedora-latest
      ansible_version: "-core >=2.15,<2.16"

- stage: Galaxy_FedoraLatest_Ansible_latest
  dependsOn: []
  jobs:
  - template: templates/galaxy_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: fedora-latest
      ansible_version: ""

# Fedora Rawhide

- stage: FedoraRawhide_Ansible_Core_2_13
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: fedora-rawhide
      ansible_version: "-core >=2.13,<2.14"

- stage: FedoraRawhide_Ansible_Core_2_14
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: fedora-rawhide
      ansible_version: "-core >=2.14,<2.15"

- stage: FedoraRawhide_Ansible_Core_2_15
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: fedora-rawhide
      ansible_version: "-core >=2.15,<2.16"

- stage: FedoraRawhide_Ansible_latest
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: fedora-rawhide
      ansible_version: ""

# CentoOS 9 Stream

- stage: c9s_Ansible_Core_2_13
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: c9s
      ansible_version: "-core >=2.13,<2.14"

- stage: c9s_Ansible_Core_2_14
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: c9s
      ansible_version: "-core >=2.14,<2.15"

- stage: c9s_Ansible_Core_2_15
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: c9s
      ansible_version: "-core >=2.15,<2.16"

- stage: c9s_Ansible_latest
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: c9s
      ansible_version: ""

# CentOS 8 Stream

- stage: c8s_Ansible_Core_2_13
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: c8s
      ansible_version: "-core >=2.13,<2.14"

- stage: c8s_Ansible_Core_2_14
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: c8s
      ansible_version: "-core >=2.14,<2.15"

- stage: c8s_Ansible_Core_2_15
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: c8s
      ansible_version: "-core >=2.15,<2.16"

- stage: c8s_Ansible_latest
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: c8s
      ansible_version: ""

# CentOS 7

- stage: CentOS7_Ansible_Core_2_13
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: centos-7
      ansible_version: "-core >=2.13,<2.14"

- stage: CentOS7_Ansible_Core_2_14
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: centos-7
      ansible_version: "-core >=2.14,<2.15"

- stage: CentOS7_Ansible_Core_2_15
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: centos-7
      ansible_version: "-core >=2.15,<2.16"

- stage: CentOS7_Ansible_latest
  dependsOn: []
  jobs:
  - template: templates/group_tests.yml
    parameters:
      build_number: $(Build.BuildNumber)
      scenario: centos-7
      ansible_version: ""
