matrix:
  platform:
    - fedora40
    - debian11
    - ubuntu2004
    - ubuntu2204
    - ubuntu2404
    - macos
    - macos_arm64
  # Used by the prof libunwind tests, since BCR libunwind only supports linux.
  prof_linux_platform:
    - fedora40
    - debian11
    - ubuntu2004
    - ubuntu2204
    - ubuntu2404
  # A subset of the prof libgcc and prof gcc tests fail on some platforms, these
  # are the only ones that pass out of the box, so just test on these.
  prof_platform:
    - fedora40
    - ubuntu2404
    - macos
    - macos_arm64
  bazel: ["7.x", "8.x", "rolling"]
tasks:
  verify_jemalloc:
    platform: ${{ platform }}
    bazel: ${{ bazel }}
    build_targets:
      - "@jemalloc//..."
    test_targets:
      - "@jemalloc//..."
  verify_jemalloc_with_prof_libunwind:
    platform: ${{ prof_linux_platform }}
    bazel: ${{ bazel }}
    build_flags:
      - "--@jemalloc//settings/flags:enable_xmalloc"
      - "--@jemalloc//settings/flags:enable_prof"
      - "--@jemalloc//settings/flags:enable_prof_libunwind"
    build_targets:
      - "@jemalloc//..."
    test_flags:
      - "--@jemalloc//settings/flags:enable_xmalloc"
      - "--@jemalloc//settings/flags:enable_prof"
      - "--@jemalloc//settings/flags:enable_prof_libunwind"
    test_targets:
      - "@jemalloc//..."
  verify_jemalloc_with_prof_libgcc:
    platform: ${{ prof_platform }}
    bazel: ${{ bazel }}
    build_flags:
      - "--@jemalloc//settings/flags:enable_xmalloc"
      - "--@jemalloc//settings/flags:enable_prof"
      - "--@jemalloc//settings/flags:enable_prof_libgcc"
    build_targets:
      - "@jemalloc//..."
    test_flags:
      - "--@jemalloc//settings/flags:enable_xmalloc"
      - "--@jemalloc//settings/flags:enable_prof"
      - "--@jemalloc//settings/flags:enable_prof_libgcc"
    test_targets:
      - "@jemalloc//..."
      # This one test fails on Mac for some reason, so just skip it.
      - "-@jemalloc//test/unit:prof_gdump"
  verify_jemalloc_with_prof_gcc:
    platform: ${{ prof_platform }}
    bazel: ${{ bazel }}
    build_flags:
      - "--@jemalloc//settings/flags:enable_xmalloc"
      - "--@jemalloc//settings/flags:enable_prof"
      - "--@jemalloc//settings/flags:enable_prof_gcc"
    build_targets:
      - "@jemalloc//..."
    test_flags:
      - "--@jemalloc//settings/flags:enable_xmalloc"
      - "--@jemalloc//settings/flags:enable_prof"
      - "--@jemalloc//settings/flags:enable_prof_gcc"
    test_targets:
      - "@jemalloc//..."
      # This one test fails on Mac for some reason, so just skip it.
      - "-@jemalloc//test/unit:prof_gdump"

bcr_test_module:
  module_path: examples
  matrix:
    platform:
      - fedora40
      - debian11
      - ubuntu2004
      - ubuntu2204
      - ubuntu2404
      - macos
      - macos_arm64
    bazel: ["7.x", "8.x", "rolling"]
  tasks:
    verify_examples:
      platform: ${{ platform }}
      bazel: ${{ bazel }}
      build_targets:
        - "//..."
      test_targets:
        - "//..."
