include:
    # Metadata shared my many jobs
    - local: .gitlab/rules.yml
    - local: .gitlab/artifacts.yml

    # OS builds.
    - local: .gitlab/os-linux.yml
    - local: .gitlab/os-windows.yml

stages:
    - build
    - test
    - analyse

################################################################################
# Job declarations
#
# Each job must pull in each of the following keys:
#
#   - a "base image"
#   - a build script
#   - tags for the jobs
#     - already provided for upload and CI update jobs
#   - rules for when to run the job
#
# Additionally, jobs may also contain:
#
#   - artifacts
#   - dependency/needs jobs for required jobs
################################################################################

# Linux

ubuntu22-debug:build:
    extends:
        - .ubuntu22_debug
        - .cmake_build_linux
        - .linux_builder_tags
        - .cmake_build_artifacts
        - .run_manually
    needs: []

ubuntu22-debug:test:
    extends:
        - .ubuntu22_debug
        - .cmake_test_linux
        - .linux_tester_tags
        - .cmake_test_artifacts
        - .run_automatically
    dependencies:
        - ubuntu22-debug:build
    needs:
        - ubuntu22-debug:build

ubuntu22-debug-tidy:build:
    extends:
        - .ubuntu22_debug_tidy
        - .cmake_build_linux
        - .linux_builder_tags
        - .cmake_tidy_artifacts
        - .run_manually
    needs: []

clang-format-check:analyse:
    extends:
        - .ubuntu22
        - .clang_format_check
        - .linux_tester_tags
        - .run_automatically
    needs: []

clang-tidy-check:analyse:
    extends:
        - .ubuntu22
        - .clang_tidy_check
        - .linux_tester_tags
        - .run_automatically
    dependencies:
        - ubuntu22-debug-tidy:build
    needs:
        - ubuntu22-debug-tidy:build

# Windows

windows-vs2019:build:
    extends:
        - .windows_vs2019
        - .cmake_build_windows
        - .windows_builder_tags
        - .cmake_build_artifacts
        - .run_manually
    needs: []

windows-vs2019:test:
    extends:
        - .windows_vs2019
        - .cmake_test_windows
        - .windows_test_tags
        - .cmake_test_artifacts
        - .run_automatically
    dependencies:
        - windows-vs2019:build
    needs:
        - windows-vs2019:build
