Add configs for CQ

Based off of the configs used in Dawn

BUG=tint:1

Change-Id: Ie6d028dd0c0ae4ce77fa689a3e080b91afd56f83
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23800
Reviewed-by: dan sinclair <dsinclair@google.com>
diff --git a/infra/config/README.md b/infra/config/README.md
new file mode 100644
index 0000000..a93b7f2
--- /dev/null
+++ b/infra/config/README.md
@@ -0,0 +1 @@
+This directory contains configurations for infra services.
diff --git a/infra/config/global/commit-queue.cfg b/infra/config/global/commit-queue.cfg
new file mode 100644
index 0000000..2157872
--- /dev/null
+++ b/infra/config/global/commit-queue.cfg
@@ -0,0 +1,64 @@
+# See http://luci-config.appspot.com/schemas/projects:commit-queue.cfg for the
+# documentation of this file format.
+
+cq_status_host: "chromium-cq-status.appspot.com"
+submit_options {
+  max_burst: 4
+  burst_delay {
+    seconds: 480
+  }
+}
+config_groups {
+  name: "Tint-CQ"
+  gerrit {
+    url: "https://dawn-review.googlesource.com"
+    projects {
+      name: "tint"
+      ref_regexp: "refs/heads/.+"
+    }
+  }
+  verifiers {
+    gerrit_cq_ability {
+      committer_list: "project-tint-committers"
+      dry_run_access_list: "project-tint-tryjob-access"
+    }
+    tryjob {
+      builders {
+        name: "tint/try/presubmit"
+        disable_reuse: true
+      }
+      builders {
+        name: "tint/try/linux-clang-dbg-x64"
+      }
+      builders {
+        name: "tint/try/linux-clang-dbg-x86"
+      }
+      builders {
+        name: "tint/try/linux-clang-rel-x64"
+      }
+      builders {
+        name: "tint/try/mac-dbg"
+      }
+      builders {
+        name: "tint/try/mac-rel"
+      }
+      builders {
+        name: "tint/try/win-clang-dbg-x64"
+      }
+      builders {
+        name: "tint/try/win-clang-dbg-x86"
+      }
+      builders {
+        name: "tint/try/win-clang-rel-x64"
+      }
+
+      retry_config {
+        single_quota: 1
+        global_quota: 2
+        failure_weight: 1
+        transient_failure_weight: 1
+        timeout_weight: 2
+      }
+    }
+  }
+}
diff --git a/infra/config/global/cr-buildbucket.cfg b/infra/config/global/cr-buildbucket.cfg
new file mode 100644
index 0000000..fa6afb9
--- /dev/null
+++ b/infra/config/global/cr-buildbucket.cfg
@@ -0,0 +1,361 @@
+# Defines buckets on cr-buildbucket.appspot.com, used to schedule builds
+# on buildbot. In particular, CQ uses some of these buckets to schedule tryjobs.
+#
+# See http://luci-config.appspot.com/schemas/projects:cr-buildbucket.cfg for
+# schema of this file and documentation.
+#
+# Please keep this list sorted by bucket name.
+
+acl_sets {
+  name: "ci"
+  acls {
+    role: READER
+    group: "all"
+  }
+  acls {
+    role: SCHEDULER
+    identity: "luci-scheduler@appspot.gserviceaccount.com"
+  }
+}
+
+acl_sets {
+  name: "try"
+  acls {
+    role: READER
+    group: "all"
+  }
+  acls {
+    role: SCHEDULER
+    group: "project-tint-tryjob-access"
+  }
+  acls {
+    role: SCHEDULER
+    group: "service-account-cq"
+  }
+}
+
+builder_mixins {
+  name: "clang"
+  recipe {
+    properties_j: "clang:true"
+  }
+}
+builder_mixins {
+  name: "no_clang"
+  recipe {
+    properties_j: "clang:false"
+  }
+}
+builder_mixins {
+  name: "release"
+  recipe {
+    properties_j: "debug:false"
+  }
+}
+builder_mixins {
+  name: "debug"
+  recipe {
+    properties_j: "debug:true"
+  }
+}
+builder_mixins {
+  name: "x86"
+  recipe {
+    properties: "target_cpu:x86"
+  }
+}
+builder_mixins {
+  name: "x64"
+  recipe {
+    properties: "target_cpu:x64"
+  }
+}
+builder_mixins {
+  name: "linux",
+  dimensions: "os:Ubuntu-16.04"
+  recipe {
+    properties_j: <<EOF
+      $build/goma: {
+        "enable_ats": true,
+        "rpc_extra_params": "?prod",
+        "server_host": "goma.chromium.org"
+      }
+    EOF
+  }
+}
+builder_mixins {
+  name: "windows",
+  dimensions: "os:Windows"
+  recipe {
+    properties_j: <<EOF
+      $build/goma: {
+        "enable_ats": true,
+        "rpc_extra_params": "?prod",
+        "server_host": "goma.chromium.org"
+      }
+    EOF
+  }
+}
+builder_mixins {
+  name: "mac"
+  dimensions: "os:Mac-10.15"
+  caches: {   # cache for depot_tools.osx_sdk recipe module
+    name: "osx_sdk"
+    path: "osx_sdk"
+  }
+  recipe {
+    properties_j: <<EOF
+      $depot_tools/osx_sdk: {
+        "sdk_version": "11b52"
+      }
+    EOF
+    properties_j: <<EOF
+      $build/goma: {
+        "rpc_extra_params": "?prod",
+        "server_host": "goma.chromium.org"
+      }
+    EOF
+  }
+}
+
+buckets {
+  name: "luci.tint.ci"
+  acl_sets: "ci"
+
+  swarming {
+    hostname: "chromium-swarm.appspot.com"
+    builder_defaults {
+      dimensions: "pool:luci.flex.ci"
+      # We have 32bit test configurations but some of our toolchain is 64bit (like CIPD)
+      dimensions: "cpu:x86-64"
+      caches {
+        path: "win_toolchain"
+        name: "win_toolchain"
+      }
+      recipe {
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/master"
+        name: "tint"
+      }
+      service_account: "tint-ci-builder@chops-service-accounts.iam.gserviceaccount.com"
+    }
+
+    # Linux: test combinations of {clang}x{release,debug}x{x86,x64}
+    builders {
+      name: "linux-clang-dbg-x64"
+      mixins: "linux"
+      mixins: "debug"
+      mixins: "x64"
+    }
+    builders {
+      name: "linux-clang-dbg-x86"
+      mixins: "linux"
+      mixins: "debug"
+      mixins: "x86"
+    }
+    builders {
+      name: "linux-clang-rel-x64"
+      mixins: "linux"
+      mixins: "release"
+      mixins: "x64"
+    }
+    builders {
+      name: "linux-clang-rel-x86"
+      mixins: "linux"
+      mixins: "release"
+      mixins: "x86"
+    }
+
+    # Mac: unlike Linux we only need to test x64 (and only clang too)
+    builders {
+      name: "mac-dbg"
+      mixins: "mac"
+      mixins: "debug"
+    }
+    builders {
+      name: "mac-rel"
+      mixins: "mac"
+      mixins: "release"
+    }
+
+    # Windows: test combinations of {clang,msvc}x{release,debug}x{x86,x64}
+    # but limit msvc to x64
+    builders {
+      name: "win-clang-dbg-x64"
+      mixins: "windows"
+      mixins: "clang"
+      mixins: "debug"
+      mixins: "x64"
+    }
+    builders {
+      name: "win-clang-dbg-x86"
+      mixins: "windows"
+      mixins: "clang"
+      mixins: "debug"
+      mixins: "x86"
+    }
+    builders {
+      name: "win-clang-rel-x64"
+      mixins: "windows"
+      mixins: "clang"
+      mixins: "release"
+      mixins: "x64"
+    }
+    builders {
+      name: "win-clang-rel-x86"
+      mixins: "windows"
+      mixins: "clang"
+      mixins: "release"
+      mixins: "x86"
+    }
+    # GOMA doesn't support MSVC builds so we don't used the "windows" mixin and
+    # instead list the dimensions: "os:Windows" directly.
+    builders {
+      name: "win-msvc-dbg-x64"
+      dimensions: "os:Windows"
+      mixins: "no_clang"
+      mixins: "debug"
+      mixins: "x64"
+    }
+    builders {
+      name: "win-msvc-rel-x64"
+      dimensions: "os:Windows"
+      mixins: "no_clang"
+      mixins: "release"
+      mixins: "x64"
+    }
+  }
+}
+
+buckets: {
+  name: "luci.tint.try"
+  acl_sets: "try"
+
+  swarming {
+    hostname: "chromium-swarm.appspot.com"
+
+    builder_defaults {
+      dimensions: "pool:luci.flex.try"
+      # We have 32bit test configurations but some of our toolchain is 64bit (like CIPD)
+      dimensions: "cpu:x86-64"
+      caches {
+        path: "win_toolchain"
+        name: "win_toolchain"
+      }
+      recipe {
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/master"
+        name: "tint"
+        properties_j: "$depot_tools/bot_update:{\"apply_patch_on_gclient\":true}"
+      }
+      service_account: "tint-try-builder@chops-service-accounts.iam.gserviceaccount.com"
+    }
+
+    builders {
+      name: "presubmit"
+      dimensions: "os:Ubuntu-16.04"
+      recipe {
+        name: "run_presubmit"
+        properties: "repo_name:tint"
+        properties_j: "runhooks:true"
+      }
+    }
+
+    # A subset of the CI configurations are used for the CQ. We still mirror
+    # the CI builders here so we can trigger tryjobs on their specific
+    # configuration.
+
+    # CI Mirror only
+    builders {
+      name: "linux-clang-dbg-x64"
+      mixins: "linux"
+      mixins: "debug"
+      mixins: "x64"
+    }
+    # Actually on the CQ
+    builders {
+      name: "linux-clang-dbg-x86"
+      mixins: "linux"
+      mixins: "debug"
+      mixins: "x86"
+    }
+    # Actually on the CQ
+    builders {
+      name: "linux-clang-rel-x64"
+      mixins: "linux"
+      mixins: "release"
+      mixins: "x64"
+    }
+    # Actually on the CQ
+    builders {
+      name: "linux-clang-rel-x86"
+      mixins: "linux"
+      mixins: "release"
+      mixins: "x86"
+    }
+
+    # Actually on the CQ
+    builders {
+      name: "mac-dbg"
+      mixins: "mac"
+      mixins: "debug"
+    }
+    # Actually on the CQ
+    builders {
+      name: "mac-rel"
+      mixins: "mac"
+      mixins: "release"
+    }
+
+    # Actually on the CQ
+    builders {
+      name: "win-clang-dbg-x64"
+      mixins: "windows"
+      mixins: "clang"
+      mixins: "debug"
+      mixins: "x64"
+    }
+    # Actually on the CQ
+    builders {
+      name: "win-clang-dbg-x86"
+      mixins: "windows"
+      mixins: "clang"
+      mixins: "debug"
+      mixins: "x86"
+    }
+    # Actually on the CQ
+    builders {
+      name: "win-clang-rel-x64"
+      mixins: "windows"
+      mixins: "clang"
+      mixins: "release"
+      mixins: "x64"
+    }
+    # CI Mirror only
+    builders {
+      name: "win-clang-rel-x86"
+      mixins: "windows"
+      mixins: "clang"
+      mixins: "release"
+      mixins: "x86"
+    }
+    # GOMA doesn't support MSVC builds so we don't used the "windows" mixin and
+    # instead list the dimensions: "os:Windows" directly.
+    # CI Mirror only
+    builders {
+      name: "win-msvc-dbg-x64"
+      dimensions: "os:Windows"
+      mixins: "no_clang"
+      mixins: "debug"
+      mixins: "x64"
+    }
+    # CI Mirror only
+    builders {
+      name: "win-msvc-rel-x64"
+      dimensions: "os:Windows"
+      mixins: "no_clang"
+      mixins: "release"
+      mixins: "x64"
+    }
+  }
+}
diff --git a/infra/config/global/luci-logdog.cfg b/infra/config/global/luci-logdog.cfg
new file mode 100644
index 0000000..3bd0e96
--- /dev/null
+++ b/infra/config/global/luci-logdog.cfg
@@ -0,0 +1,17 @@
+# Copyright (c) 2018 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# For the schema of this file and documentation, see ProjectConfig message in
+# https://luci-config.appspot.com/schemas/services/luci-logdog:logdog.cfg
+
+# Auth groups who can read log streams.
+reader_auth_groups: "all"
+
+# Auth groups who can register and emit new log streams.
+writer_auth_groups: "luci-logdog-chromium-writers"
+
+# The base Google Storage archival path for this project.
+#
+# Archived LogDog logs will be written to this bucket/path.
+archive_gs_bucket: "chromium-luci-logdog"
diff --git a/infra/config/global/luci-milo.cfg b/infra/config/global/luci-milo.cfg
new file mode 100644
index 0000000..7f5a18f
--- /dev/null
+++ b/infra/config/global/luci-milo.cfg
@@ -0,0 +1,102 @@
+consoles {
+  id: "ci"
+  name: "Tint CI Builders"
+  repo_url: "https://dawn.googlesource.com/tint"
+  refs: "refs/heads/main"
+  manifest_name: "REVISION"
+
+  builders {
+    name: "buildbucket/luci.tint.ci/linux-clang-dbg-x64"
+    category: "linux|clang|dbg"
+    short_name: "x64"
+  }
+  builders {
+    name: "buildbucket/luci.tint.ci/linux-clang-dbg-x86"
+    category: "linux|clang|dbg"
+    short_name: "x86"
+  }
+  builders {
+    name: "buildbucket/luci.tint.ci/linux-clang-rel-x64"
+    category: "linux|clang|rel"
+    short_name: "x64"
+  }
+  builders {
+    name: "buildbucket/luci.tint.ci/linux-clang-rel-x86"
+    category: "linux|clang|rel"
+    short_name: "x86"
+  }
+
+  builders {
+    name: "buildbucket/luci.tint.ci/mac-dbg"
+    category: "mac"
+    short_name: "dbg"
+  }
+  builders {
+    name: "buildbucket/luci.tint.ci/mac-rel"
+    category: "mac"
+    short_name: "rel"
+  }
+
+  builders {
+    name: "buildbucket/luci.tint.ci/win-clang-dbg-x64"
+    category: "win|clang|dbg"
+    short_name: "x64"
+  }
+  builders {
+    name: "buildbucket/luci.tint.ci/win-clang-dbg-x86"
+    category: "win|clang|dbg"
+    short_name: "x86"
+  }
+  builders {
+    name: "buildbucket/luci.tint.ci/win-clang-rel-x64"
+    category: "win|clang|rel"
+    short_name: "x64"
+  }
+  builders {
+    name: "buildbucket/luci.tint.ci/win-clang-rel-x86"
+    category: "win|clang|rel"
+    short_name: "x86"
+  }
+  builders {
+    name: "buildbucket/luci.tint.ci/win-msvc-dbg-x64"
+    category: "win|msvc"
+    short_name: "dbg"
+  }
+  builders {
+    name: "buildbucket/luci.tint.ci/win-msvc-rel-x64"
+    category: "win|msvc"
+    short_name: "rel"
+  }
+}
+
+consoles {
+  id: "try"
+  name: "Tint try Builders"
+  manifest_name: "PATCHED"
+  builder_view_only: true
+
+  builders {
+    name: "buildbucket/luci.tint.try/presubmit"
+  }
+
+  builders {
+    name: "buildbucket/luci.tint.try/linux-clang-dbg-x64"
+  }
+  builders {
+    name: "buildbucket/luci.tint.try/linux-clang-rel-x64"
+  }
+
+  builders {
+    name: "buildbucket/luci.tint.try/mac-dbg"
+  }
+  builders {
+    name: "buildbucket/luci.tint.try/mac-rel"
+  }
+
+  builders {
+    name: "buildbucket/luci.tint.try/win-clang-dbg-x64"
+  }
+  builders {
+    name: "buildbucket/luci.tint.try/win-clang-rel-x64"
+  }
+}
diff --git a/infra/config/global/luci-scheduler.cfg b/infra/config/global/luci-scheduler.cfg
new file mode 100644
index 0000000..f8bddcb
--- /dev/null
+++ b/infra/config/global/luci-scheduler.cfg
@@ -0,0 +1,150 @@
+# Defines jobs on luci-scheduler.appspot.com.
+#
+# For schema of this file and documentation see ProjectConfig message in
+#
+# https://chromium.googlesource.com/infra/luci/luci-go/+/master/scheduler/appengine/messages/cron.proto
+
+
+acl_sets {
+  name: "default"
+  acls {
+    role: READER
+    granted_to: "group:all"
+  }
+  acls {
+    role: OWNER
+    granted_to: "group:project-tint-admins"
+  }
+}
+
+trigger {
+  id: "master-gitiles-trigger"
+  acl_sets: "default"
+  gitiles {
+    repo: "https://dawn.googlesource.com/tint.git"
+    refs: "refs/heads/main"
+  }
+  triggers: "linux-clang-dbg-x64"
+  triggers: "linux-clang-rel-x64"
+  triggers: "linux-clang-dbg-x86"
+  triggers: "linux-clang-rel-x86"
+  triggers: "mac-dbg"
+  triggers: "mac-rel"
+  triggers: "win-clang-dbg-x64"
+  triggers: "win-clang-rel-x64"
+  triggers: "win-clang-dbg-x86"
+  triggers: "win-clang-rel-x86"
+  triggers: "win-msvc-dbg-x64"
+  triggers: "win-msvc-rel-x64"
+}
+
+job {
+  id: "linux-clang-dbg-x64"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.tint.ci"
+    builder: "linux-clang-dbg-x64"
+  }
+}
+job {
+  id: "linux-clang-dbg-x86"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.tint.ci"
+    builder: "linux-clang-dbg-x86"
+  }
+}
+job {
+  id: "linux-clang-rel-x64"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.tint.ci"
+    builder: "linux-clang-rel-x64"
+  }
+}
+job {
+  id: "linux-clang-rel-x86"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.tint.ci"
+    builder: "linux-clang-rel-x86"
+  }
+}
+
+job {
+  id: "mac-dbg"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.tint.ci"
+    builder: "mac-dbg"
+  }
+}
+job {
+  id: "mac-rel"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.tint.ci"
+    builder: "mac-rel"
+  }
+}
+
+job {
+  id: "win-clang-dbg-x64"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.tint.ci"
+    builder: "win-clang-dbg-x64"
+  }
+}
+job {
+  id: "win-clang-dbg-x86"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.tint.ci"
+    builder: "win-clang-dbg-x86"
+  }
+}
+job {
+  id: "win-clang-rel-x64"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.tint.ci"
+    builder: "win-clang-rel-x64"
+  }
+}
+job {
+  id: "win-clang-rel-x86"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.tint.ci"
+    builder: "win-clang-rel-x86"
+  }
+}
+job {
+  id: "win-msvc-dbg-x64"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.tint.ci"
+    builder: "win-msvc-dbg-x64"
+  }
+}
+job {
+  id: "win-msvc-rel-x64"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.tint.ci"
+    builder: "win-msvc-rel-x64"
+  }
+}
diff --git a/infra/config/global/project.cfg b/infra/config/global/project.cfg
new file mode 100644
index 0000000..93caacb
--- /dev/null
+++ b/infra/config/global/project.cfg
@@ -0,0 +1,4 @@
+# For the schema of this file and documentation, see ProjectCfg message in
+# https://luci-config.appspot.com/schemas/projects:project.cfg
+name: "tint"
+access: "group:all"  # The project is public, everybody can see build results.
diff --git a/infra/config/global/refs.cfg b/infra/config/global/refs.cfg
new file mode 100644
index 0000000..6f1e356
--- /dev/null
+++ b/infra/config/global/refs.cfg
@@ -0,0 +1,6 @@
+# Refs configuration file. The documentation of the format can be found
+# at https://luci-config.appspot.com/schemas/projects:refs.cfg.
+refs {
+  name: "refs/heads/main"
+  config_path: "infra/config/branch"
+}