matrix:
  platform:
  - ubuntu2004
  - macos
tasks:
  verify_targets:
    name: Verify build targets
    platform: ${{ platform }}
    environment:
      ERLANG_VERSION: "24.3"
    shell_commands:
    - curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl
    - chmod a+x kerl
    - ./kerl update releases
    - ./kerl build ${ERLANG_VERSION}
    - ./kerl install ${ERLANG_VERSION} ~/kerl/${ERLANG_VERSION}
    - |
        ERLANG_HOME="$(realpath ~/kerl/${ERLANG_VERSION})"
        cat << EOF >> .bazelrc
          build --@rules_erlang//:erlang_version=${ERLANG_VERSION}
          build --@rules_erlang//:erlang_home=${ERLANG_HOME}
        EOF
    build_flags:
    - --incompatible_strict_action_env
    build_targets:
    - '@rules_erlang//...'
