---
x_defaults:
  common: &common
    platform: macos
    xcode_version: "12.4"
    build_targets:
    - "//:tulsi"
    test_flags:
    - "--nocheck_visibility"
    test_targets:
    - "//:tests"

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

---
x_defaults:
  common: &common
    platform: macos
    xcode_version: "12.4"
    build_targets:
    - "//:tulsi"
    test_flags:
    - "--nocheck_visibility"
    # TODO: Replace absolute home directory with `~` and move this to .bazelrc
    # when --sandbox_writable_path supports relative paths.
    # https://github.com/bazelbuild/bazel/issues/10304
    - "--sandbox_writable_path=/Users/buildkite/Library/Application Support"
    test_targets:
    - "//:tests"

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

Make '~/Library/Application Support' writable for tests running in sandboxed mode
Make '~/Library/Application Support' writable for tests running in
sandboxed mode
