---

tasks:
  rockylinux8:
    shards: 4
    shell_commands:
      - rm -rf $HOME/bazeltest
      - mkdir $HOME/bazeltest
    build_flags:
      - "--config=ci-linux"
    build_targets:
      - "//:bazel-distfile.zip"
      - "//scripts/packages/debian:bazel-debian.deb"
      - "//scripts/packages:with-jdk/install.sh"
      - "//src:bazel"
      - "//src:bazel_jdk_minimal"
      - "//src:test_repos"
      - "//src/main/java/..."
      - "//src/tools/diskcache/..."
      - "//src/tools/execlog/..."
    test_flags:
      - "--config=ci-linux"
    test_targets:
      - "//scripts/..."
      - "//src/java_tools/..."
      - "//src/main/starlark/tests/builtins_bzl/..."
      - "//src/test/..."
      - "//src/tools/execlog/..."
      - "//src/tools/one_version/..."
      - "//src/tools/singlejar/..."
      - "//src/tools/workspacelog/..."
      - "//third_party/ijar/..."
      - "//tools/aquery_differ/..."
      - "//tools/compliance/..."
      - "//tools/python/..."
      - "//tools/bash/..."
      # These tests are not compatible with the gcov version of Rocky Linux 8.
      - "-//src/test/shell/bazel:bazel_cc_code_coverage_test"
      - "-//src/test/shell/bazel:bazel_coverage_cc_released_test_gcc"
      - "-//src/test/shell/bazel:bazel_coverage_cc_head_test_gcc"
      - "-//src/test/shell/bazel:bazel_coverage_sh_test"
      # Disable some Android tests since we are moving Android rules out of the Bazel repo.
      - "-//src/test/shell/bazel:bazel_android_tools_test"
    include_json_profile:
      - build
      - test
  rockylinux8_arm64:
    shell_commands:
      - rm -rf $HOME/bazeltest
      - mkdir $HOME/bazeltest
    build_flags:
      - "--config=ci-linux"
    build_targets:
      - "//:bazel-distfile.zip"
      - "//scripts/packages/debian:bazel-debian.deb"
      - "//scripts/packages:with-jdk/install.sh"
      - "//src:bazel"
      - "//src:bazel_jdk_minimal"
      - "//src:test_repos"
      - "//src/main/java/..."
      - "//src/tools/diskcache/..."
      - "//src/tools/execlog/..."
    include_json_profile:
      - build
  fedora39:
    shell_commands:
      - rm -rf $HOME/bazeltest
      - mkdir $HOME/bazeltest
    build_flags:
      - "--config=ci-linux"
    build_targets:
      - "//src:bazel"
      - "//src:bazel_jdk_minimal"
      - "//src/main/java/..."
    include_json_profile:
      - build
      - test
  ubuntu2204:
    shards: 4
    shell_commands:
      - rm -rf $HOME/bazeltest
      - mkdir $HOME/bazeltest
    build_flags:
      - "--config=ci-linux"
    build_targets:
      - "//src:bazel"
      - "//src:bazel_jdk_minimal"
      - "//src:test_repos"
      - "//src/main/java/..."
    test_flags:
      - "--config=ci-linux"
    test_targets:
      - "//scripts/..."
      - "//src/java_tools/..."
      - "//src/main/starlark/tests/builtins_bzl/..."
      - "//src/test/..."
      - "//src/tools/execlog/..."
      - "//src/tools/one_version/..."
      - "//src/tools/singlejar/..."
      - "//src/tools/workspacelog/..."
      - "//third_party/ijar/..."
      - "//tools/aquery_differ/..."
      - "//tools/python/..."
      - "//tools/bash/..."
      # Disable some Android tests since we are moving Android rules out of the Bazel repo.
      - "-//src/test/shell/bazel:bazel_android_tools_test"
    include_json_profile:
      - build
      - test
  ubuntu2004_clang:
    platform: ubuntu2004
    environment:
      CC: clang
      CC_CONFIGURE_DEBUG: 1
    name: "Clang"
    shell_commands:
      - rm -rf $HOME/bazeltest
      - mkdir $HOME/bazeltest
    build_flags:
      - "--config=ci-linux"
    build_targets:
      - "//src:bazel"
      - "//src:bazel_jdk_minimal"
      - "//src:test_repos"
      - "//src/main/java/..."
    test_flags:
      - "--config=ci-linux"
    test_targets:
      - "//src/test/shell/bazel:cc_integration_test"
    include_json_profile:
      - build
      - test
  ubuntu2004:
    shards: 4
    shell_commands:
      - rm -rf $HOME/bazeltest
      - mkdir $HOME/bazeltest
    build_flags:
      - "--config=ci-linux"
    build_targets:
      - "//src:bazel"
      - "//src:bazel_jdk_minimal"
      - "//src:test_repos"
      - "//src/main/java/..."
    test_flags:
      - "--config=ci-linux"
    test_targets:
      - "//scripts/..."
      - "//src/java_tools/..."
      - "//src/main/starlark/tests/builtins_bzl/..."
      - "//src/test/..."
      - "//src/tools/execlog/..."
      - "//src/tools/one_version/..."
      - "//src/tools/singlejar/..."
      - "//src/tools/workspacelog/..."
      - "//third_party/ijar/..."
      - "//tools/aquery_differ/..."
      - "//tools/python/..."
      - "//tools/bash/..."
      # Disable some Android tests since we are moving Android rules out of the Bazel repo.
      - "-//src/test/shell/bazel:bazel_android_tools_test"
    include_json_profile:
      - build
      - test
  macos:
    shards: 10
    shell_commands:
      - rm -rf $HOME/bazeltest
      - mkdir $HOME/bazeltest
      - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external
    build_flags:
      - "--config=ci-macos"
    build_targets:
      - "//src:bazel"
      - "//src:bazel_jdk_minimal"
      - "//src:test_repos"
    test_flags:
      - "--config=ci-macos"
      # Fine tune the number of test jobs running in parallel to avoid timeout
      - "--local_test_jobs=2"
    test_targets:
      - "//scripts/..."
      - "//src/main/starlark/tests/builtins_bzl/..."
      - "//src/test/..."
      - "//src/tools/execlog/..."
      - "//src/tools/one_version/..."
      - "//src/tools/singlejar/..."
      - "//src/tools/workspacelog/..."
      - "//third_party/ijar/..."
      - "//tools/aquery_differ/..."
      - "//tools/python/..."
      - "//tools/bash/..."
      # Disable python and shell integration tests on Intel Macs
      - "-//src/test/shell/..."
      - "-//src/test/py/..."
      - "-//src/main/starlark/tests/builtins_bzl:cc_builtin_tests"
      # https://github.com/bazelbuild/bazel/issues/17410
      - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest"
      # Disable android tests since we are moving Android rules out of the Bazel repo.
      # ServerTests frequently runs into deadlocks on Intel Macs
      - "-//src/test/java/com/google/devtools/build/lib/server:ServerTests"
      # Add back a few Apple specific tests
      - "+//src/test/shell/bazel/apple/..."
    include_json_profile:
      - build
      - test
  macos_arm64:
    shards: 10
    shell_commands:
      - rm -rf $HOME/bazeltest
      - mkdir $HOME/bazeltest
      - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external
    build_flags:
      - "--config=ci-macos"
    build_targets:
      - "//src:bazel"
      - "//src:bazel_jdk_minimal"
      - "//src:test_repos"
    test_flags:
      - "--config=ci-macos"
      # Fine tune the number of test jobs running in parallel to avoid timeout
      - "--local_test_jobs=2"
      # Increase the test timeout by 20% to avoid flaky test failures due to timeout
      - "--test_timeout=72,360,1080,4320"
    test_targets:
      - "//scripts/..."
      - "//src/main/starlark/tests/builtins_bzl/..."
      - "//src/test/..."
      - "//src/tools/execlog/..."
      - "//src/tools/one_version/..."
      - "//src/tools/singlejar/..."
      - "//src/tools/workspacelog/..."
      - "//third_party/ijar/..."
      - "//tools/aquery_differ/..."
      - "//tools/python/..."
      - "//tools/bash/..."
      # https://github.com/bazelbuild/bazel/issues/17410
      - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest"
      # Disable android tests since we are moving Android rules out of Bazel repo.
      - "-//src/test/shell/bazel:bazel_android_tools_test"
    include_json_profile:
      - build
      - test
  windows:
    shards: 4
    setup:
      - mkdir C:\b
      - mklink /J C:\b\bazeltest_external %OUTPUT_BASE:/=\%\external
    build_flags:
      - "--config=ci-windows"
    build_targets:
      - "//src:bazel.exe"
      - "//src:bazel_jdk_minimal"
      - "//src:test_repos"
      - "//src/main/java/..."
    test_flags:
      - "--config=ci-windows"
      # We need to keep --test_tag_filters here for the bazel-diff integration.
      - "--test_tag_filters=-no_windows,-slow"
    test_targets:
      - "//src:embedded_tools_size_test"
      - "//src/main/starlark/tests/builtins_bzl/..."
      - "//src/test/cpp/..."
      - "//src/test/java/com/google/devtools/build/lib/..."
      - "//src/test/java/com/google/devtools/build/skyframe/..."
      - "//src/test/java/com/google/devtools/common/options/..."
      - "//src/test/native/windows/..."
      - "//src/test/py/bazel/..."
      - "//src/test/res/..."
      - "//src/test/shell/..."
      - "//src/tools/launcher/..."
      - "//src/tools/one_version/..."
      - "//src/tools/singlejar/..."
      - "//third_party/def_parser/..."
      - "//tools/aquery_differ/..."
      - "//tools/bash/..."
      - "//tools/build_defs/..."
      - "//tools/java/..."
      - "//tools/jdk/..."
      - "//tools/python/..."
      - "//tools/test/..."
      # Re-enable the following tests on Windows:
      # https://github.com/bazelbuild/bazel/issues/4292
      - "-//src/test/java/com/google/devtools/build/lib/query2/cquery/..."
      - "-//src/test/java/com/google/devtools/build/lib/query2/engine/..."
      - "-//src/test/java/com/google/devtools/build/lib/versioning/..."
      - "-//src/test/java/com/google/devtools/build/lib/worker/..."
      - "-//src/test/java/com/google/devtools/build/lib/remote:RemoteTests"
      - "-//src/test/shell/bazel/remote/..."
      - "-//tools/python:pywrapper_test"
    include_json_profile:
      - build
      - test
  windows_arm64:
    platform: windows
    name: "Windows (arm64)"
    setup:
      - mkdir C:\b
      - mklink /J C:\b\bazeltest_external %OUTPUT_BASE:/=\%\external
    build_flags:
      - "--config=ci-windows"
      - "--config=windows_arm64"
    build_targets:
      - "//src:bazel.exe"
      - "//src:bazel_nojdk.exe"
    include_json_profile:
      - build
  rbe_ubuntu2004:
    platform: ubuntu2004
    name: "RBE"
    build_flags:
      - "--config=remote"
      - "--remote_executor=grpcs://remotebuildexecution.googleapis.com"
      - "--jobs=200"
      - "--experimental_remote_cache_async"
      - "--experimental_remote_merkle_tree_cache"
      - "--remote_download_minimal"
      - "--experimental_output_paths=strip"
    build_targets:
      - "//src:bazel"
      - "//src:bazel_jdk_minimal"
      - "//src/main/java/..."
    test_flags:
      - "--config=remote"
      - "--remote_executor=grpcs://remotebuildexecution.googleapis.com"
      - "--jobs=200"
      - "--experimental_remote_cache_async"
      - "--experimental_remote_merkle_tree_cache"
      - "--remote_download_minimal"
      - "--experimental_output_paths=strip"
    test_targets:
      - "//scripts/..."
      - "//src/java_tools/..."
      - "//src/main/starlark/tests/builtins_bzl/..."
      - "//src/test/..."
      - "//src/tools/execlog/..."
      - "//src/tools/one_version/..."
      - "//src/tools/singlejar/..."
      - "//src/tools/workspacelog/..."
      - "//third_party/ijar/..."
      - "//tools/aquery_differ/..."
      - "//tools/python/..."
      - "//tools/bash/..."
      # See https://github.com/bazelbuild/bazel/issues/8033
      - "-//src/tools/singlejar:output_jar_simple_test"
      - "-//src/test/shell/bazel:external_integration_test"
      - "-//src/test/shell/bazel:bazel_repository_cache_test"
      - "-//src/test/shell/integration:java_integration_test"
      - "-//src/test/java/com/google/devtools/build/lib/sandbox/..."
      # We hit connection timeout error when downloading multiple URLs on RBE, see b/217865760
      - "-//src/test/py/bazel:bazel_module_test"
      - "-//src/test/py/bazel:bazel_lockfile_test"
      - "-//src/test/py/bazel:bazel_overrides_test"
      - "-//src/test/py/bazel:bazel_repo_mapping_test"
      - "-//src/test/py/bazel:bazel_yanked_versions_test"
      - "-//src/test/py/bazel:bzlmod_query_test"
      - "-//src/test/py/bazel:mod_command_test"
      - "-//src/test/shell/bazel:starlark_repository_test"
      - "-//src/test/shell/bazel:verify_workspace"
      # Flaky on rbe_ubuntu2004
      # https://github.com/bazelbuild/continuous-integration/issues/1631
      - "-//src/test/shell/bazel:bazel_sandboxing_networking_test"
      # Disable some Android tests since we are moving Android rules out of the Bazel repo.
      - "-//src/test/shell/bazel:bazel_android_tools_test"
    include_json_profile:
      - build
      - test
  kythe_ubuntu2204:
    shell_commands:
    # Replace @com_google_protobuf with @protobuf because Bazel has renamed @com_google_protobuf to @protobuf. See b/371908235.
    # TODO(chiwang): Remove this once kythe is updated to use @protobuf.
    - sed -i -e 's/@com_google_protobuf/@protobuf/' /usr/local/kythe/BUILD
    # Remove _nowkt suffix because it's only available in newer protobuf releases. See b/329055020.
    # TODO(chiwang): Remove this once we have upgraded to protobuf 25+.
    - sed -i -e 's/protobuf_nowkt/protobuf/' /usr/local/kythe/BUILD
    index_flags:
    - "--define=kythe_corpus=github.com/bazelbuild/bazel"
    index_targets_query: "kind(\"cc_(binary|library|test|proto_library) rule\", ...) union kind(\"java_(binary|import|library|plugin|test|proto_library) rule\", ...) union kind(\"proto_library rule\", ...)"
    index_upload_policy: Always
    index_upload_gcs: False
  docs_ubuntu2004:
    platform: ubuntu2004
    name: "Docs"
    build_flags:
      - "--config=docs"
    build_targets:
      - "//scripts/docs:gen_release_docs"
      - "//src/main/java/com/google/devtools/build/lib:gen_reference_docs"
