---
x_defaults:
  # YAML has a feature for "repeated nodes", BazelCI is fine with extra nodes
  # it doesn't know about; so that is used to avoid repeating common subparts.
  common: &common
    platform: macos
    build_targets:
    - "tools/..."
    - "test/..."
    test_targets:
    - "doc/..."
    - "tools/..."
    - "test/..."
    - "examples/..."

# NOTE: To avoid listing the same things for build_flags/test_flags for each
# of these tasks, they are listed in the .bazelrc instead.
tasks:
  macos_latest:
    name: "Latest Bazel"
    bazel: latest
    <<: *common

  macos_last_green:
    name: "Last Green Bazel"
    bazel: last_green
    <<: *common

  macos_latest_head_deps:
    name: "Latest Bazel with Head Deps"
    bazel: latest
    shell_commands:
    # Update the WORKSPACE to use head versions of some deps to ensure nothing
    # has landed on them breaking this project.
    - .bazelci/update_workspace_to_deps_heads.sh
    <<: *common

  macos_last_green_head_deps:
    name: "Last Green Bazel with Head Deps"
    bazel: last_green
    shell_commands:
    # Update the WORKSPACE to use head versions of some deps to ensure nothing
    # has landed on them breaking this project.
    - .bazelci/update_workspace_to_deps_heads.sh
    <<: *common

buildifier: latest

---
x_defaults:
  # YAML has a feature for "repeated nodes", BazelCI is fine with extra nodes
  # it doesn't know about; so that is used to avoid repeating common subparts.
  common: &common
    platform: macos
    build_targets:
    - "tools/..."
    - "test/..."
    test_targets:
    - "doc/..."
    - "tools/..."
    - "test/..."
    - "examples/..."

# NOTE: To avoid listing the same things for build_flags/test_flags for each
# of these tasks, they are listed in the .bazelrc instead.
tasks:
  macos_rolling:
    name: "Rolling Bazel"
    bazel: rolling
    <<: *common

  macos_last_green:
    name: "Last Green Bazel"
    bazel: last_green
    <<: *common

  macos_rolling_head_deps:
    name: "Rolling Bazel with Head Deps"
    bazel: rolling
    shell_commands:
    # Update the WORKSPACE to use head versions of some deps to ensure nothing
    # has landed on them breaking this project.
    - .bazelci/update_workspace_to_deps_heads.sh
    <<: *common

  macos_last_green_head_deps:
    name: "Last Green Bazel with Head Deps"
    bazel: last_green
    shell_commands:
    # Update the WORKSPACE to use head versions of some deps to ensure nothing
    # has landed on them breaking this project.
    - .bazelci/update_workspace_to_deps_heads.sh
    <<: *common

buildifier: latest

Remove bazel release version from CI
Remove bazel release version from CI

Bazel made a breaking change that makes it impossible for us to support
5.x and bazel HEAD at the same time. This drops support for 5.x on CI,
and adds the most recent rolling release instead.

If we ever want to create a new 5.x release, we'll have to do so off the
another branch.

https://github.com/bazelbuild/bazel/issues/14996
