matrix:
  platform: ["centos7", "debian10", "macos", "ubuntu2004", "windows"]

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

bcr_test_module:
  module_path: "tests"
  matrix:
    platform: ["debian10", "macos", "ubuntu2004", "windows"]
  tasks:
    run_tests:
      name: "Run test module"
      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"
      platform: centos7
      environment:
        JAVA_HOME: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64
      test_targets:
      - "//..."
