matrix:
  bazel: [6.x, 7.x]
  platform: ["centos7", "debian10", "macos", "ubuntu2004", "windows"]

tasks:
  build_targets:
    name: "Build targets under //jni"
    bazel: ${{ bazel }}
    platform: ${{ platform }}
    build_targets:
      - "@rules_jni//jni/..."

bcr_test_module:
  module_path: "tests"
  matrix:
    bazel: [6.x, 7.x]
    platform: ["debian10", "macos", "ubuntu2004", "windows"]
  tasks:
    run_tests:
      name: "Run test module"
      bazel: ${{ bazel }}
      platform: ${{ platform }}
      test_targets:
        - "//..."
    # The CentOS image does not set JAVA_HOME. To make the tests work, we set it
    # manually.
    run_tests_centos7:
      name: "Run test module"
      bazel: ${{ bazel }}
      platform: centos7
      environment:
        JAVA_HOME: /usr/lib/jvm/zulu21
      test_targets:
        - "//..."
